Skip to content

Commit

Permalink
Refactor release workflow: streamline permissions and cleanup comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mojocn authored Dec 30, 2024
1 parent 8ef69fd commit de19e76
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,28 @@ name: Release

on:
release:
types: [published] # 当 Release 发布时触发
types: [published]


jobs:
build:
name: Build Binaries
permissions:
contents: write # IMPORTANT: Grant write access to contents (includes releases)
contents: write
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64 # Windows on ARM64 is less common

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.23' # 使用你的 Go 版本
go-version: '1.23'

- name: Build executable
id: build
Expand All @@ -37,6 +35,7 @@ jobs:
run: |
cd bin/${{ matrix.goos }}-${{ matrix.goarch }}
if [[ "${{ matrix.goos }}" == "windows" ]]; then
mv unchain unchain.exe
zip unchain.zip unchain.exe
else
tar -czvf unchain.tar.gz unchain
Expand Down

0 comments on commit de19e76

Please sign in to comment.