Skip to content

Commit 27cc880

Browse files
committed
chore(ci): registry bot signing
1 parent aeb8cdc commit 27cc880

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

.github/workflows/marketplace-build.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ on:
2222
secrets:
2323
MINISIGN_SECRET_KEY:
2424
required: true
25+
REGISTRY_GPG_PRIVATE_KEY:
26+
required: true
27+
REGISTRY_GPG_PASSPHRASE:
28+
required: true
29+
REGISTRY_GPG_KEY_ID:
30+
required: true
2531

2632
env:
2733
CARGO_TERM_COLOR: always
@@ -188,12 +194,37 @@ jobs:
188194
mkdir -p docs/public/registry
189195
cp -R dist/registry/* docs/public/registry/
190196
197+
- name: Configure signed registry commits
198+
env:
199+
REGISTRY_GPG_PRIVATE_KEY: ${{ secrets.REGISTRY_GPG_PRIVATE_KEY }}
200+
REGISTRY_GPG_PASSPHRASE: ${{ secrets.REGISTRY_GPG_PASSPHRASE }}
201+
REGISTRY_GPG_KEY_ID: ${{ secrets.REGISTRY_GPG_KEY_ID }}
202+
run: |
203+
mkdir -p ~/.gnupg
204+
chmod 700 ~/.gnupg
205+
echo "${REGISTRY_GPG_PRIVATE_KEY}" | gpg --batch --import
206+
key_id="${REGISTRY_GPG_KEY_ID}"
207+
passphrase_file="/tmp/registry-gpg-passphrase"
208+
printf "%s" "${REGISTRY_GPG_PASSPHRASE}" > "${passphrase_file}"
209+
chmod 600 "${passphrase_file}"
210+
cat > /tmp/gpg-wrapper.sh <<'EOF'
211+
#!/usr/bin/env bash
212+
exec gpg --batch --yes --pinentry-mode loopback --passphrase-file /tmp/registry-gpg-passphrase "$@"
213+
EOF
214+
chmod +x /tmp/gpg-wrapper.sh
215+
git config user.name "StreamKit Registry Bot"
216+
git config user.email "registry-bot@streamkit.dev"
217+
git config user.signingkey "${key_id}"
218+
git config commit.gpgsign true
219+
git config gpg.program /tmp/gpg-wrapper.sh
220+
191221
- name: Create pull request
192222
uses: peter-evans/create-pull-request@v6
193223
with:
194-
branch: "registry/${{ env.RELEASE_TAG }}"
224+
branch: "registry/${{ env.RELEASE_TAG }}-${{ github.run_id }}"
195225
title: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
196226
commit-message: "chore(registry): publish marketplace registry for ${{ env.RELEASE_TAG }}"
197227
body: |
198228
Automated registry metadata update for `${{ env.RELEASE_TAG }}`.
229+
delete-branch: true
199230
base: main

RELEASING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ and marketplace-only releases share the same reusable marketplace workflow
6363
Ensure "Allow GitHub Actions to create and approve pull requests" is enabled
6464
in repo settings so the registry PR can be opened automatically.
6565

66+
Registry PR commits are signed by the workflow. Add these secrets:
67+
68+
- `REGISTRY_GPG_PRIVATE_KEY`: ASCII-armored private key for the registry bot
69+
- `REGISTRY_GPG_PASSPHRASE`: passphrase for the private key
70+
- `REGISTRY_GPG_KEY_ID`: GPG key fingerprint for the registry bot
71+
6672
### Verify outputs
6773

6874
- GitHub Release includes `*-bundle.tar.zst` assets.

0 commit comments

Comments
 (0)