From a8765f85a767988f688b0bd54d7863f1dc3470d1 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 18:16:05 +0800 Subject: [PATCH] chore: update GitHub Actions workflows to latest action versions and enhance release configuration - Upgraded checkout action from v3 to v4 in both auto-tag.yml and release.yml for improved performance. - Added optional input for GPG private key in release.yml to support signing releases. - Updated setup-go action from v4 to v5 and goreleaser action from v4 to v5, ensuring compatibility with the latest features. - Changed GoReleaser version specification to 'latest' for automatic updates. --- .github/workflows/auto-tag.yml | 2 +- .github/workflows/release.yml | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml index 1b65afc..a449eb3 100644 --- a/.github/workflows/auto-tag.yml +++ b/.github/workflows/auto-tag.yml @@ -18,7 +18,7 @@ jobs: outputs: new_tag: ${{ steps.get_latest_tag.outputs.version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 763e3f5..95e8b34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,11 @@ name: Release on: workflow_call: + inputs: + gpg_private_key: + description: "GPG private key to sign releases" + required: false + type: string secrets: RELEASE_TOKEN: required: true @@ -20,31 +25,31 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true submodules: recursive - name: Set up Go - uses: actions/setup-go@v4 + 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@v5 + uses: crazy-max/ghaction-import-gpg@v6 if: "${{ secrets.GPG_PRIVATE_KEY != '' }}" with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser - version: v1.21.2 + version: latest args: release --clean env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}