Make GPG signing optional in release workflow
All checks were successful
CI / build (push) Successful in 33s
Endpoint Sync Check / check-drift (push) Successful in 18s
Release / release (push) Successful in 4m53s

Skip GPG import and pass --skip sign to GoReleaser when
GPG_PRIVATE_KEY secret is not configured. Allows releases
to proceed without signing until keys are set up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-16 02:33:31 -04:00
parent e26c78e2c2
commit b86137f0b8

View File

@@ -18,6 +18,7 @@ jobs:
go-version-file: go.mod
- name: Import GPG key
if: ${{ secrets.GPG_PRIVATE_KEY != '' }}
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
@@ -27,10 +28,19 @@ jobs:
- name: Check endpoint drift
run: go run ./scripts/check-endpoint-drift.go
- name: Run GoReleaser
- name: Run GoReleaser (signed)
if: ${{ steps.import_gpg.outputs.fingerprint != '' }}
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
- name: Run GoReleaser (unsigned)
if: ${{ steps.import_gpg.outputs.fingerprint == '' }}
uses: goreleaser/goreleaser-action@v6
with:
args: release --clean --skip sign
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}