2020-05-03 15:09:41 -04:00
|
|
|
name: ci
|
|
|
|
|
|
|
|
on:
|
2020-05-23 19:14:15 -04:00
|
|
|
schedule:
|
2021-10-15 07:40:04 -04:00
|
|
|
- cron: '0 10 * * *'
|
2020-05-03 15:09:41 -04:00
|
|
|
push:
|
|
|
|
branches:
|
2021-01-29 06:29:31 -05:00
|
|
|
- 'master'
|
|
|
|
- 'releases/v*'
|
2021-03-30 14:00:40 -04:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
2021-01-29 06:29:31 -05:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2021-03-30 14:00:40 -04:00
|
|
|
- 'releases/v*'
|
2020-05-03 15:09:41 -04:00
|
|
|
|
|
|
|
jobs:
|
2021-11-19 06:54:41 -05:00
|
|
|
gpg:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: GPG conf
|
|
|
|
run: |
|
|
|
|
cat ~/.gnupg/gpg.conf || true
|
|
|
|
|
2020-05-18 11:18:07 -04:00
|
|
|
armored:
|
2020-05-03 15:35:54 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-10-15 07:40:04 -04:00
|
|
|
key:
|
|
|
|
- test-key
|
|
|
|
- test-subkey
|
2021-08-10 03:28:13 -04:00
|
|
|
global:
|
|
|
|
- false
|
|
|
|
- true
|
2020-05-03 15:35:54 -04:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macOS-latest
|
2020-05-05 18:31:46 -04:00
|
|
|
- windows-latest
|
2021-10-15 07:40:04 -04:00
|
|
|
include:
|
|
|
|
- key: test-subkey
|
|
|
|
fingerprint: C17D11ADF199F12A30A0910F1F80449BE0B08CB8
|
2020-05-03 15:09:41 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-07 20:56:13 -05:00
|
|
|
uses: actions/checkout@v2
|
2021-10-15 07:40:04 -04:00
|
|
|
-
|
|
|
|
name: GPG conf
|
2022-02-14 06:06:02 -05:00
|
|
|
uses: actions/github-script@v6
|
2021-10-15 07:40:04 -04:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const fs = require('fs');
|
|
|
|
const gnupgfolder = `${require('os').homedir()}/.gnupg`;
|
|
|
|
if (!fs.existsSync(gnupgfolder)){
|
|
|
|
fs.mkdirSync(gnupgfolder);
|
|
|
|
}
|
|
|
|
fs.copyFile('__tests__/fixtures/gpg.conf', `${gnupgfolder}/gpg.conf`, (err) => {
|
|
|
|
if (err) throw err;
|
|
|
|
});
|
2020-05-12 14:18:51 -04:00
|
|
|
-
|
2020-05-12 14:48:02 -04:00
|
|
|
name: Get test key and passphrase
|
2022-02-14 06:06:02 -05:00
|
|
|
uses: actions/github-script@v6
|
2020-05-12 14:30:44 -04:00
|
|
|
id: test
|
2020-05-12 14:36:05 -04:00
|
|
|
with:
|
|
|
|
script: |
|
2020-05-12 14:37:28 -04:00
|
|
|
const fs = require('fs');
|
2021-10-15 07:40:04 -04:00
|
|
|
core.setOutput('pgp', fs.readFileSync('__tests__/fixtures/${{ matrix.key }}.pgp', {encoding: 'utf8'}));
|
|
|
|
core.setOutput('passphrase', fs.readFileSync('__tests__/fixtures/${{ matrix.key }}.pass', {encoding: 'utf8'}));
|
2020-05-03 15:09:41 -04:00
|
|
|
-
|
2020-05-18 11:18:07 -04:00
|
|
|
name: Import GPG
|
2020-05-07 14:46:52 -04:00
|
|
|
id: import_gpg
|
2020-05-03 15:09:41 -04:00
|
|
|
uses: ./
|
2020-05-04 14:59:11 -04:00
|
|
|
with:
|
2021-09-04 19:12:28 -04:00
|
|
|
gpg_private_key: ${{ steps.test.outputs.pgp }}
|
2020-09-06 16:03:16 -04:00
|
|
|
passphrase: ${{ steps.test.outputs.passphrase }}
|
2021-09-04 19:12:28 -04:00
|
|
|
git_config_global: ${{ matrix.global }}
|
|
|
|
git_user_signingkey: true
|
|
|
|
git_commit_gpgsign: true
|
|
|
|
git_tag_gpgsign: true
|
|
|
|
git_push_gpgsign: if-asked
|
2021-10-15 07:40:04 -04:00
|
|
|
fingerprint: ${{ matrix.fingerprint }}
|
2020-05-07 14:46:52 -04:00
|
|
|
-
|
2021-10-15 07:40:04 -04:00
|
|
|
name: List keys
|
2020-05-07 14:46:52 -04:00
|
|
|
run: |
|
2021-10-15 07:40:04 -04:00
|
|
|
gpg -K
|
|
|
|
shell: bash
|
2020-05-18 11:18:07 -04:00
|
|
|
|
|
|
|
base64:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-10-15 07:40:04 -04:00
|
|
|
key:
|
|
|
|
- test-key
|
|
|
|
- test-subkey
|
2020-05-18 11:18:07 -04:00
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macOS-latest
|
|
|
|
- windows-latest
|
2021-10-15 07:40:04 -04:00
|
|
|
include:
|
|
|
|
- key: test-subkey
|
|
|
|
fingerprint: C17D11ADF199F12A30A0910F1F80449BE0B08CB8
|
2020-05-18 11:18:07 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2020-11-07 20:56:13 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-05-18 11:15:05 -04:00
|
|
|
-
|
2020-05-18 11:18:07 -04:00
|
|
|
name: Get test key and passphrase
|
2022-02-14 06:06:02 -05:00
|
|
|
uses: actions/github-script@v6
|
2020-05-18 11:18:07 -04:00
|
|
|
id: test
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const fs = require('fs');
|
2021-10-15 07:40:04 -04:00
|
|
|
core.setOutput('pgp-base64', fs.readFileSync('__tests__/fixtures/${{ matrix.key }}-base64.pgp', {encoding: 'utf8'}));
|
|
|
|
core.setOutput('passphrase', fs.readFileSync('__tests__/fixtures/${{ matrix.key }}.pass', {encoding: 'utf8'}));
|
2020-05-18 11:18:07 -04:00
|
|
|
-
|
|
|
|
name: Import GPG
|
|
|
|
id: import_gpg
|
2020-05-18 11:15:05 -04:00
|
|
|
uses: ./
|
|
|
|
with:
|
2021-09-04 19:12:28 -04:00
|
|
|
gpg_private_key: ${{ steps.test.outputs.pgp-base64 }}
|
2020-09-06 16:03:16 -04:00
|
|
|
passphrase: ${{ steps.test.outputs.passphrase }}
|
2021-09-04 19:12:28 -04:00
|
|
|
git_user_signingkey: true
|
|
|
|
git_commit_gpgsign: true
|
|
|
|
git_tag_gpgsign: true
|
|
|
|
git_push_gpgsign: if-asked
|
2021-10-15 07:40:04 -04:00
|
|
|
fingerprint: ${{ matrix.fingerprint }}
|