File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 1+ name : publish
2+
3+ on :
4+ push :
5+ paths :
6+ - " **.go"
7+ - " .github/workflows/publish.yml"
8+
9+ jobs :
10+ build-and-release :
11+ name : Build and Release Binaries
12+ runs-on : ubuntu-latest
13+
14+ permissions :
15+ contents : write
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Go
22+ uses : actions/setup-go@v5
23+ with :
24+ go-version : " 1.22"
25+
26+ - name : Set version
27+ id : version
28+ run : echo "VERSION=v0.2.0" >> $GITHUB_OUTPUT
29+
30+ - name : Build binaries
31+ run : |
32+ mkdir -p build
33+ GOOS=linux GOARCH=amd64 go build -o build/gstats-linux .
34+ GOOS=windows GOARCH=amd64 go build -o build/gstats-windows.exe .
35+ GOOS=darwin GOARCH=amd64 go build -o build/gstats-macos .
36+
37+ - name : Create GitHub Release
38+ uses : softprops/action-gh-release@v2
39+ with :
40+ tag_name : ${{ steps.version.outputs.VERSION }}
41+ name : gstats ${{ steps.version.outputs.VERSION }}
42+ files : |
43+ build/gstats-linux
44+ build/gstats-windows.exe
45+ build/gstats-macos
46+ env :
47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments