From 66e91f92c76e720fb371e649a95aa03ae871ccaa Mon Sep 17 00:00:00 2001 From: jm12138 <2286040843@qq.com> Date: Mon, 4 Nov 2024 14:37:23 +0800 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e083ebc..046528d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,28 +1,33 @@ -name: Release +name: Release Go Project on: push: tags: - - "v*.*.*" # 只在 tag 推送时触发,例如 v1.0.0 + - 'v*.*.*' + +permissions: + contents: write jobs: - release: + goreleaser: runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.23' # 设置 Go 版本 - - - name: Install GoReleaser - run: | - go install github.com/goreleaser/goreleaser/v2@latest - + go-version: '>=1.23.0' + cache: true + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: goreleaser release --clean