mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 12:32:06 +08:00
chore: update auto-tag workflow and GitHub Actions versions
- Simplified the workflow_call input in auto-tag-release.yml by removing unnecessary inputs. - Updated actions/checkout and actions/setup-go to version 3 for improved performance and compatibility. - Refined conditional checks for version tagging to use the new syntax for better clarity. - Adjusted GoReleaser action to version 3, ensuring alignment with the latest features and fixes.
This commit is contained in:
parent
2d008db25e
commit
c41ade9b88
23
.github/workflows/auto-tag-release.yml
vendored
23
.github/workflows/auto-tag-release.yml
vendored
@ -13,8 +13,7 @@ on:
|
|||||||
- "**.md"
|
- "**.md"
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
- ".gitignore"
|
- ".gitignore"
|
||||||
workflow_call:
|
workflow_call: {}
|
||||||
inputs:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -28,7 +27,7 @@ jobs:
|
|||||||
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
steps:
|
steps:
|
||||||
- id: skip_check
|
- id: skip_check
|
||||||
uses: fkirc/skip-duplicate-actions@v5.3.1
|
uses: fkirc/skip-duplicate-actions@v5.3.0
|
||||||
with:
|
with:
|
||||||
cancel_others: "true"
|
cancel_others: "true"
|
||||||
concurrent_skipping: "same_content"
|
concurrent_skipping: "same_content"
|
||||||
@ -48,14 +47,14 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
lfs: true
|
lfs: true
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
check-latest: true
|
check-latest: true
|
||||||
@ -75,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
# 只在非tag推送时执行自动打tag
|
# 只在非tag推送时执行自动打tag
|
||||||
- name: Get latest tag
|
- name: Get latest tag
|
||||||
if: "!startsWith(github.ref, 'refs/tags/v')"
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
id: get_latest_tag
|
id: get_latest_tag
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@ -97,7 +96,7 @@ jobs:
|
|||||||
echo "Generated version: $new_version"
|
echo "Generated version: $new_version"
|
||||||
|
|
||||||
- name: Validate version
|
- name: Validate version
|
||||||
if: "!startsWith(github.ref, 'refs/tags/v')"
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
new_tag="${{ steps.get_latest_tag.outputs.version }}"
|
new_tag="${{ steps.get_latest_tag.outputs.version }}"
|
||||||
@ -116,7 +115,7 @@ jobs:
|
|||||||
echo "Version validation passed"
|
echo "Version validation passed"
|
||||||
|
|
||||||
- name: Create new tag
|
- name: Create new tag
|
||||||
if: "!startsWith(github.ref, 'refs/tags/v')"
|
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@ -152,8 +151,8 @@ jobs:
|
|||||||
|
|
||||||
# 修改 GoReleaser 步骤
|
# 修改 GoReleaser 步骤
|
||||||
- name: Run GoReleaser
|
- name: Run GoReleaser
|
||||||
if: startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '')
|
if: ${{ startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') }}
|
||||||
uses: goreleaser/goreleaser-action@v4
|
uses: goreleaser/goreleaser-action@v3
|
||||||
with:
|
with:
|
||||||
distribution: goreleaser
|
distribution: goreleaser
|
||||||
version: latest
|
version: latest
|
||||||
@ -192,9 +191,7 @@ jobs:
|
|||||||
|
|
||||||
# 改进验证步骤
|
# 改进验证步骤
|
||||||
- name: Verify Release
|
- name: Verify Release
|
||||||
if: |
|
if: ${{ startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') }}
|
||||||
startsWith(github.ref, 'refs/tags/v') ||
|
|
||||||
(success() && steps.get_latest_tag.outputs.version != '')
|
|
||||||
run: |
|
run: |
|
||||||
echo "Verifying release artifacts..."
|
echo "Verifying release artifacts..."
|
||||||
if [ ! -d "dist" ]; then
|
if [ ! -d "dist" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user