Bring back support for Windows

This commit is contained in:
CrazyMax 2020-05-06 00:31:46 +02:00
parent 3b574952da
commit 16c87f2e17
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
6 changed files with 13 additions and 17 deletions

View file

@ -17,6 +17,7 @@ jobs:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
name: Checkout

View file

@ -17,6 +17,7 @@ jobs:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
# https://github.com/actions/checkout

View file

@ -14,7 +14,7 @@ If you are interested, [check out](https://git.io/Je09Y) my other :octocat: GitH
## Features
* Works on Linux and MacOS [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources)
* Works on Linux, MacOS and Windows [virtual environments](https://help.github.com/en/articles/virtual-environments-for-github-actions#supported-virtual-environments-and-hardware-resources)
* Allow to seed the internal cache of `gpg-agent` with provided passphrase
* Enable signing for Git commits and tags
* Configure and check committer info against GPG key

14
dist/index.js generated vendored
View file

@ -1010,23 +1010,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
result["default"] = mod;
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(__webpack_require__(470));
const git = __importStar(__webpack_require__(453));
const gpg = __importStar(__webpack_require__(207));
const openpgp = __importStar(__webpack_require__(781));
const stateHelper = __importStar(__webpack_require__(153));
const os_1 = __importDefault(__webpack_require__(87));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
if (os_1.default.platform() == 'win32') {
core.setFailed('Windows platform not supported');
return;
}
if (!process.env.SIGNING_KEY) {
core.setFailed('Signing key required');
return;
@ -1145,7 +1137,11 @@ const getGnupgHome = () => __awaiter(void 0, void 0, void 0, function* () {
if (process.env.GNUPGHOME) {
return process.env.GNUPGHOME;
}
return path.join(process.env.HOME || '', '.gnupg');
let homedir = path.join(process.env.HOME || '', '.gnupg');
if (os.platform() == 'win32' && !process.env.HOME) {
homedir = path.join(process.env.USERPROFILE || '', '.gnupg');
}
return homedir;
});
const gpgConnectAgent = (command) => __awaiter(void 0, void 0, void 0, function* () {
return yield exec.exec(`gpg-connect-agent "${command}" /bye`, [], true).then(res => {

View file

@ -23,7 +23,11 @@ const getGnupgHome = async (): Promise<string> => {
if (process.env.GNUPGHOME) {
return process.env.GNUPGHOME;
}
return path.join(process.env.HOME || '', '.gnupg');
let homedir: string = path.join(process.env.HOME || '', '.gnupg');
if (os.platform() == 'win32' && !process.env.HOME) {
homedir = path.join(process.env.USERPROFILE || '', '.gnupg');
}
return homedir;
};
const gpgConnectAgent = async (command: string): Promise<string> => {

View file

@ -3,15 +3,9 @@ import * as git from './git';
import * as gpg from './gpg';
import * as openpgp from './openpgp';
import * as stateHelper from './state-helper';
import os from 'os';
async function run(): Promise<void> {
try {
if (os.platform() == 'win32') {
core.setFailed('Windows platform not supported');
return;
}
if (!process.env.SIGNING_KEY) {
core.setFailed('Signing key required');
return;