diff --git a/.github/scripts/configure-git.js b/.github/scripts/configure-git.js index 77c7659..ea6ab5d 100644 --- a/.github/scripts/configure-git.js +++ b/.github/scripts/configure-git.js @@ -1,4 +1,5 @@ import { $ } from "execa"; +import { rm, writeFile } from "node:fs/promises"; const email = "928067+conventional-versioning[bot]@users.noreply.github.com"; const name = "Conventional Versioning"; @@ -15,12 +16,17 @@ await $`git config --global credential.helper store`; await $`echo ${`https://x-access-token:${GITHUB_TOKEN}@github.com`} >> ~/.git-credentials`; // Setup GPG -await $`echo ${GPG_PRIVATE_KEY} | gpg --import`; +await $`mkdir -p ~/.gnupg`; +const gpgPrivateKeyPath = "gpg-private-key.asc"; +await writeFile(gpgPrivateKeyPath, GPG_PRIVATE_KEY + "\n"); +await $`gpg --import ${gpgPrivateKeyPath}`; +await rm(gpgPrivateKeyPath); await $`echo "default-key ${GPG_KEY_ID}" >> ~/.gnupg/gpg.conf`; await $`echo "use-agent" >> ~/.gnupg/gpg.conf`; await $`echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf`; await $`echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf`; -await $`gpg --batch --yes --passphrase ${GPG_PASSPHRASE} --quick-set-expire ${GPG_KEY_ID} 1y`; +await $`echo RELOADAGENT | gpg-connect-agent`; +await $`echo ${GPG_PASSPHRASE} | gpg --batch --yes --passphrase-fd 0 --quick-set-expire ${GPG_KEY_ID} 1y`; // Configure commit signing await $`git config --global user.signingkey ${GPG_KEY_ID}`; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0905bcd..3ef9272 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ permissions: jobs: version: - name: Release + name: Version runs-on: ubuntu-latest steps: - name: Checkout Repository (deep)