From c41ade9b88801b782b19673898a74d668ddc12b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=85=8E=E9=A5=BC=E6=9E=9C=E5=AD=90=E5=8D=B7=E9=B2=A8?= =?UTF-8?q?=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Mon, 30 Dec 2024 19:21:30 +0800 Subject: [PATCH] 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. --- .github/workflows/auto-tag-release.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/auto-tag-release.yml b/.github/workflows/auto-tag-release.yml index d8057a1..eb55560 100644 --- a/.github/workflows/auto-tag-release.yml +++ b/.github/workflows/auto-tag-release.yml @@ -13,8 +13,7 @@ on: - "**.md" - "LICENSE" - ".gitignore" - workflow_call: - inputs: + workflow_call: {} permissions: contents: write @@ -28,7 +27,7 @@ jobs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - id: skip_check - uses: fkirc/skip-duplicate-actions@v5.3.1 + uses: fkirc/skip-duplicate-actions@v5.3.0 with: cancel_others: "true" concurrent_skipping: "same_content" @@ -48,14 +47,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true submodules: recursive - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v3 with: go-version: "1.21" check-latest: true @@ -75,7 +74,7 @@ jobs: # 只在非tag推送时执行自动打tag - name: Get latest tag - if: "!startsWith(github.ref, 'refs/tags/v')" + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} id: get_latest_tag run: | set -euo pipefail @@ -97,7 +96,7 @@ jobs: echo "Generated version: $new_version" - name: Validate version - if: "!startsWith(github.ref, 'refs/tags/v')" + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} run: | set -euo pipefail new_tag="${{ steps.get_latest_tag.outputs.version }}" @@ -116,7 +115,7 @@ jobs: echo "Version validation passed" - name: Create new tag - if: "!startsWith(github.ref, 'refs/tags/v')" + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -152,8 +151,8 @@ jobs: # 修改 GoReleaser 步骤 - name: Run GoReleaser - if: startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') - uses: goreleaser/goreleaser-action@v4 + if: ${{ startsWith(github.ref, 'refs/tags/v') || (success() && steps.get_latest_tag.outputs.version != '') }} + uses: goreleaser/goreleaser-action@v3 with: distribution: goreleaser version: latest @@ -192,9 +191,7 @@ jobs: # 改进验证步骤 - name: Verify Release - 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 != '') }} run: | echo "Verifying release artifacts..." if [ ! -d "dist" ]; then