mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-07-08 21:37:30 +00:00
Artifact signing (#2)
This commit is contained in:
+10
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user