Use GnuPG Chocolatey on Windows

This commit is contained in:
CrazyMax 2020-05-04 19:29:58 +02:00
parent 2d5664ca5a
commit 28569120f0
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 13 additions and 0 deletions

6
dist/index.js generated vendored
View file

@ -1016,6 +1016,7 @@ const gpg = __importStar(__webpack_require__(207));
const openpgp = __importStar(__webpack_require__(781)); const openpgp = __importStar(__webpack_require__(781));
const stateHelper = __importStar(__webpack_require__(153)); const stateHelper = __importStar(__webpack_require__(153));
const exec = __importStar(__webpack_require__(986)); const exec = __importStar(__webpack_require__(986));
const os = __importStar(__webpack_require__(87));
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
@ -1023,6 +1024,11 @@ function run() {
core.setFailed('Signing key required'); core.setFailed('Signing key required');
return; return;
} }
if (os.platform() == 'win32') {
core.info('🏃 Installing GnuPG...');
yield exec.exec(`choco feature enable -n=allowGlobalConfirmation`);
yield exec.exec(`choco install gnupg`);
}
core.info('📣 GnuPG info'); core.info('📣 GnuPG info');
yield exec.exec('which', ['gpg']); yield exec.exec('which', ['gpg']);
const version = yield gpg.getVersion(); const version = yield gpg.getVersion();

View file

@ -3,6 +3,7 @@ import * as gpg from './gpg';
import * as openpgp from './openpgp'; import * as openpgp from './openpgp';
import * as stateHelper from './state-helper'; import * as stateHelper from './state-helper';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
import * as os from 'os';
async function run(): Promise<void> { async function run(): Promise<void> {
try { try {
@ -11,6 +12,12 @@ async function run(): Promise<void> {
return; return;
} }
if (os.platform() == 'win32') {
core.info('🏃 Installing GnuPG...');
await exec.exec(`choco feature enable -n=allowGlobalConfirmation`);
await exec.exec(`choco install gnupg`);
}
core.info('📣 GnuPG info'); core.info('📣 GnuPG info');
await exec.exec('which', ['gpg']); await exec.exec('which', ['gpg']);
const version = await gpg.getVersion(); const version = await gpg.getVersion();