Skip to content

Commit 3bbfb1c

Browse files
add: release configs
1 parent 4c5860a commit 3bbfb1c

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Create Alpha Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "alpha-*" # Trigger on tags that start with 'alpha-'
7+
8+
jobs:
9+
build:
10+
name: Build and Release Binaries
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
goos: [linux, darwin, windows]
16+
goarch: [amd64, arm64, 386]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: "1.23" # Specify your Go version here
26+
27+
- name: Build binary
28+
run: |
29+
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o myapp-${{ matrix.goos }}-${{ matrix.goarch }}
30+
31+
- name: Archive binary
32+
run: |
33+
zip myapp-${{ matrix.goos }}-${{ matrix.goarch }}.zip myapp-${{ matrix.goos }}-${{ matrix.goarch }}
34+
35+
- name: Create GitHub Release
36+
id: create_release
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
files: myapp-${{ matrix.goos }}-${{ matrix.goarch }}.zip
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Upload release assets
44+
uses: actions/upload-release-asset@v1
45+
with:
46+
upload_url: ${{ steps.create_release.outputs.upload_url }}
47+
asset_path: ./myapp-${{ matrix.goos }}-${{ matrix.goarch }}.zip
48+
asset_name: myapp-${{ matrix.goos }}-${{ matrix.goarch }}.zip
49+
asset_content_type: application/zip

0 commit comments

Comments
 (0)