feat: Use native GitHub Action tools to download assets and use GitHub API (#187)

* Use native GitHub Action tools to download assets and use GitHub API
* Fix unexpected output when tag not found
* Use GitHub Action exec
* Add screenshot

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2020-05-07 02:15:24 +02:00
committed by GitHub
parent 88f1da8c86
commit 6c7b10c265
16 changed files with 269 additions and 23170 deletions
+3 -7
View File
@@ -4,7 +4,7 @@ import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as fs from 'fs';
export async function run(silent?: boolean) {
async function run(): Promise<void> {
try {
const version = core.getInput('version') || 'latest';
const args = core.getInput('args');
@@ -37,15 +37,11 @@ export async function run(silent?: boolean) {
core.info('🔑 Importing signing key...');
let path = `${process.env.HOME}/key.asc`;
fs.writeFileSync(path, key, {mode: 0o600});
await exec.exec('gpg', ['--import', path], {
silent: silent
});
await exec.exec('gpg', ['--import', path]);
}
core.info('🏃 Running GoReleaser...');
await exec.exec(`${goreleaser} ${args}${snapshot}`, undefined, {
silent: silent
});
await exec.exec(`${goreleaser} ${args}${snapshot}`);
} catch (error) {
core.setFailed(error.message);
}