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
+11
View File
@@ -1,11 +1,13 @@
import * as installer from './installer';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as fs from 'fs';
export async function run(silent?: boolean) {
try {
const version = core.getInput('version') || 'latest';
const args = core.getInput('args');
const key = core.getInput('key');
const goreleaser = await installer.getGoReleaser(version);
let snapshot = '';
@@ -21,6 +23,15 @@ export async function run(silent?: boolean) {
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})
await exec.exec('gpg', ['--import', path], {
silent: silent
})
}
console.log('🏃 Running GoReleaser...');
await exec.exec(`${goreleaser} ${args}${snapshot}`, undefined, {
silent: silent