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>
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
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:
|
|
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
|
passphrase: ${{ secrets.PASSPHRASE }}
|
|
|
|
- name: Check endpoint drift
|
|
run: go run ./scripts/check-endpoint-drift.go
|
|
|
|
- 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 }}
|