Make GPG signing optional in release workflow
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:
@@ -18,6 +18,7 @@ jobs:
|
|||||||
go-version-file: go.mod
|
go-version-file: go.mod
|
||||||
|
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
|
if: ${{ secrets.GPG_PRIVATE_KEY != '' }}
|
||||||
id: import_gpg
|
id: import_gpg
|
||||||
uses: crazy-max/ghaction-import-gpg@v6
|
uses: crazy-max/ghaction-import-gpg@v6
|
||||||
with:
|
with:
|
||||||
@@ -27,10 +28,19 @@ jobs:
|
|||||||
- name: Check endpoint drift
|
- name: Check endpoint drift
|
||||||
run: go run ./scripts/check-endpoint-drift.go
|
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
|
uses: goreleaser/goreleaser-action@v6
|
||||||
with:
|
with:
|
||||||
args: release --clean
|
args: release --clean
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user