mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 04:22:06 +08:00
chore: enhance auto-tag workflow with GPG signing options and build summary
- Added inputs for optional GPG private key and skip signing functionality to the workflow. - Updated conditions for GPG signing to allow skipping based on input parameters. - Introduced a new step to generate a build summary, detailing Go version, release version, GPG signing status, and build status, improving visibility into the release process.
This commit is contained in:
parent
b9bd994803
commit
97e6e5165e
30
.github/workflows/auto-tag-release.yml
vendored
30
.github/workflows/auto-tag-release.yml
vendored
@ -13,6 +13,17 @@ on:
|
||||
- "**.md"
|
||||
- "LICENSE"
|
||||
- ".gitignore"
|
||||
workflow_call:
|
||||
inputs:
|
||||
gpg_private_key:
|
||||
required: false
|
||||
type: string
|
||||
description: "GPG private key for signing releases"
|
||||
skip_signing:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Skip GPG signing of releases"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@ -130,7 +141,7 @@ jobs:
|
||||
if: |
|
||||
(startsWith(github.ref, 'refs/tags/v') ||
|
||||
(success() && steps.get_latest_tag.outputs.version != '')) &&
|
||||
secrets.GPG_PRIVATE_KEY != ''
|
||||
!inputs.skip_signing
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
@ -191,7 +202,7 @@ jobs:
|
||||
if: |
|
||||
(startsWith(github.ref, 'refs/tags/v') ||
|
||||
(success() && steps.get_latest_tag.outputs.version != '')) &&
|
||||
secrets.GPG_PRIVATE_KEY == ''
|
||||
(inputs.skip_signing || steps.import_gpg.outcome == 'skipped')
|
||||
uses: goreleaser/goreleaser-action@v4
|
||||
with:
|
||||
distribution: goreleaser
|
||||
@ -247,3 +258,18 @@ jobs:
|
||||
if: failure()
|
||||
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 "- Build Status: ${{ job.status }}" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
if [ -d "dist" ]; then
|
||||
echo "### Generated Artifacts" >> $GITHUB_STEP_SUMMARY
|
||||
ls -lh dist/ | awk '{print "- "$9" ("$5")"}' >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user