Skip to content

Commit

Permalink
ci: fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tscpp committed Jun 24, 2024
1 parent 0667c1f commit c3d6893
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/scripts/configure-git.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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}`;
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ permissions:

jobs:
version:
name: Release
name: Version
runs-on: ubuntu-latest
steps:
- name: Checkout Repository (deep)
Expand Down

0 comments on commit c3d6893

Please sign in to comment.