@ -131,22 +131,6 @@ jobs:
git tag -a $new_tag -m "Release $new_tag"
git push origin $new_tag
# Release 相关步骤
- name : Import GPG key
id : import_gpg
if : |
(startsWith(github.ref, 'refs/tags/v') ||
(success() && steps.get_latest_tag.outputs.version != '')) &&
!inputs.skip_signing
uses : crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
passphrase : ${{ secrets.PASSPHRASE }}
git_config_global : true
git_user_signingkey : true
git_commit_gpgsign : true
git_tag_gpgsign : true
# 在 Run GoReleaser 之前添加配置检查步骤
- name : Check GoReleaser config
run : |
@ -171,34 +155,9 @@ jobs:
go mod vendor
fi
# 修改 GoReleaser 步骤的环境变量
# 修改 GoReleaser 步骤
- name : Run GoReleaser
if : |
(startsWith(github.ref, 'refs/tags/v') ||
(success() && steps.get_latest_tag.outputs.version != '')) &&
(steps.import_gpg.outcome == 'success' || steps.import_gpg.outcome == 'skipped')
uses : goreleaser/goreleaser-action@v4
with:
distribution : goreleaser
version : latest
args : release --clean --timeout 60m
env:
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
VERSION : ${{ steps.get_latest_tag.outputs.version }}
CGO_ENABLED : 0
GOFLAGS : -mod=vendor
GOPATH : ${{ github.workspace }}/go
GOROOT : ${{ env.GOROOT }}
GOCACHE : ${{ github.workspace }}/.cache/go-build
GOMODCACHE : ${{ github.workspace }}/go/pkg/mod
# 修改无 GPG 的 GoReleaser 步骤
- name : Run GoReleaser without GPG
if : |
(startsWith(github.ref, 'refs/tags/v') ||
(success() && steps.get_latest_tag.outputs.version != '')) &&
(inputs.skip_signing || steps.import_gpg.outcome == 'skipped')
if : startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '')
uses : goreleaser/goreleaser-action@v4
with:
distribution : goreleaser