chore: update GoReleaser configuration and enhance auto-tag workflow

- Added 'go mod download' step to ensure dependencies are available before builds.
- Introduced debug flag in GoReleaser execution for improved troubleshooting.
- Added error checking step to capture GoReleaser output and configuration details on failure.
- Modified build summary step to reflect GPG signing status as disabled, streamlining the release process.
This commit is contained in:
煎饼果子卷鲨鱼辣椒
2024-12-30 19:17:46 +08:00
parent f0f77352ae
commit bf6adcbac2
2 changed files with 21 additions and 67 deletions

View File

@@ -162,7 +162,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean --timeout 60m --skip-sign
args: release --clean --timeout 60m --skip-sign --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.get_latest_tag.outputs.version }}
@@ -173,6 +173,23 @@ jobs:
GOCACHE: ${{ github.workspace }}/.cache/go-build
GOMODCACHE: ${{ github.workspace }}/go/pkg/mod
# 添加错误检查步骤
- name: Check GoReleaser Output
if: failure()
run: |
echo "::group::GoReleaser Debug Info"
cat dist/artifacts.json || true
echo "::endgroup::"
echo "::group::GoReleaser Config"
cat .goreleaser.yml
echo "::endgroup::"
echo "::group::Environment Info"
go version
go env
echo "::endgroup::"
- name: Set Release Version
if: startsWith(github.ref, 'refs/tags/v')
run: |
@@ -214,14 +231,14 @@ jobs:
run: |
echo "::error::Release process failed"
# 添加构建摘要步骤
# 修改构建摘要步骤
- name: Build Summary
if: always()
run: |
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
echo "- Go Version: $(go version)" >> $GITHUB_STEP_SUMMARY
echo "- Release Version: ${VERSION:-N/A}" >> $GITHUB_STEP_SUMMARY
echo "- GPG Signing: ${{ steps.import_gpg.outcome == 'success' && 'Enabled' || 'Disabled' }}" >> $GITHUB_STEP_SUMMARY
echo "- GPG Signing: Disabled" >> $GITHUB_STEP_SUMMARY
echo "- Build Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
if [ -d "dist" ]; then