v1.0.0 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, darwin, windows] | |
goarch: [amd64, 386] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20 # 根据你的Go版本设置 | |
- name: Build binaries | |
run: | | |
mkdir -p dist | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/${{ matrix.goos }}_${{ matrix.goarch }}/your-project | |
- name: Upload binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: your-project-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: dist/${{ matrix.goos }}_${{ matrix.goarch }}/your-project | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download binaries | |
uses: actions/download-artifact@v3 | |
with: | |
path: dist | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/**/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Notify success | |
run: echo "Release created successfully!" |