mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 04:22:06 +08:00

- Upgraded checkout action from v3 to v4 in both auto-tag.yml and release.yml for improved performance. - Updated setup-go action from v4 to v5 and goreleaser action from v4 to v5 to leverage the latest features. - Changed the release job to inherit secrets instead of explicitly defining them, enhancing security. - Added environment specification for the goreleaser job and refined the conditional execution for the release process.
67 lines
1.6 KiB
YAML
67 lines
1.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
version:
|
|
description: "Version to release"
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
RELEASE_TOKEN:
|
|
required: true
|
|
description: "GitHub token for release"
|
|
GPG_PRIVATE_KEY:
|
|
required: true
|
|
description: "GPG private key for signing"
|
|
PASSPHRASE:
|
|
required: true
|
|
description: "Passphrase for GPG key"
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
permissions: write-all
|
|
|
|
jobs:
|
|
goreleaser:
|
|
environment: production
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
lfs: true
|
|
submodules: recursive
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.21"
|
|
cache: true
|
|
|
|
- name: Import GPG key
|
|
id: import_gpg
|
|
uses: crazy-max/ghaction-import-gpg@v6
|
|
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
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v5
|
|
with:
|
|
distribution: goreleaser
|
|
version: latest
|
|
args: release --clean
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
|
VERSION: ${{ inputs.version }}
|
|
|
|
if: github.event_name == 'workflow_call' || startsWith(github.ref, 'refs/tags/v')
|