Browse Source

chore: update GitHub Actions workflows for auto-tagging and release processes

- Updated permissions in both auto-tag.yml and release.yml to include write access for issues and pull requests.
- Changed the checkout action version from v4 to v3 in both workflows for consistency.
- Updated Go setup action version from v5 to v4 and specified the Go version as "1.21".
- Adjusted GPG import action version from v6 to v5.
- Updated GoReleaser action version from v5 to v4 and specified the release version as v1.21.2.
- Standardized string quotes in YAML files for consistency.
pull/122/head v0.0.8
煎饼果子卷鲨鱼辣椒 5 months ago
parent
commit
fa53723283
  1. 15
      .github/workflows/auto-tag.yml
  2. 16
      .github/workflows/release.yml

15
.github/workflows/auto-tag.yml

@ -6,19 +6,21 @@ on:
- master - master
- main - main
paths-ignore: paths-ignore:
- '**.md'
- 'LICENSE'
- '.gitignore'
- "**.md"
- "LICENSE"
- ".gitignore"
jobs: jobs:
auto-tag: auto-tag:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
issues: write
pull-requests: write
outputs: outputs:
new_tag: ${{ steps.get_latest_tag.outputs.version }} new_tag: ${{ steps.get_latest_tag.outputs.version }}
steps: steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
@ -50,4 +52,9 @@ jobs:
release: release:
needs: auto-tag needs: auto-tag
uses: ./.github/workflows/release.yml uses: ./.github/workflows/release.yml
permissions:
contents: write
packages: write
issues: write
pull-requests: write
secrets: inherit secrets: inherit

16
.github/workflows/release.yml

@ -4,18 +4,20 @@ on:
workflow_call: workflow_call:
push: push:
tags: tags:
- 'v*'
- "v*"
permissions: permissions:
contents: write contents: write
packages: write packages: write
issues: write
pull-requests: write
jobs: jobs:
goreleaser: goreleaser:
runs-on: ubuntu-latest runs-on: ubuntu-latest
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
@ -29,24 +31,24 @@ jobs:
ls -R ls -R
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v4
with: with:
go-version: '1.21'
go-version: "1.21"
cache: true cache: true
- name: Import GPG key - name: Import GPG key
id: import_gpg id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
uses: crazy-max/ghaction-import-gpg@v5
with: with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }} passphrase: ${{ secrets.PASSPHRASE }}
if: ${{ env.GPG_PRIVATE_KEY != '' }} if: ${{ env.GPG_PRIVATE_KEY != '' }}
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v4
with: with:
distribution: goreleaser distribution: goreleaser
version: latest
version: v1.21.2
args: release --clean args: release --clean
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Loading…
Cancel
Save