Artifact signing (#2)

This commit is contained in:
Gavin Cabbage
2019-09-26 08:17:18 -04:00
committed by CrazyMax
parent bb450e4e69
commit be0c56834b
4 changed files with 38 additions and 0 deletions
+10
View File
@@ -19,11 +19,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
const installer = __importStar(require("./installer"));
const core = __importStar(require("@actions/core"));
const exec = __importStar(require("@actions/exec"));
const fs = __importStar(require("fs"));
function run(silent) {
return __awaiter(this, void 0, void 0, function* () {
try {
const version = core.getInput('version') || 'latest';
const args = core.getInput('args');
const key = core.getInput('key');
const goreleaser = yield installer.getGoReleaser(version);
let snapshot = '';
if (!process.env.GITHUB_REF ||
@@ -36,6 +38,14 @@ function run(silent) {
else {
console.log(`${process.env.GITHUB_REF.split('/')[2]} tag found`);
}
if (key) {
console.log('🔑 Importing signing key...');
let path = `${process.env.HOME}/key.asc`;
fs.writeFileSync(path, key, { mode: 0o600 });
yield exec.exec('gpg', ['--import', path], {
silent: silent
});
}
console.log('🏃 Running GoReleaser...');
yield exec.exec(`${goreleaser} ${args}${snapshot}`, undefined, {
silent: silent