-
Notifications
You must be signed in to change notification settings - Fork 3
32 lines (26 loc) · 1.27 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: release
on:
push:
tags:
- v*
jobs:
release:
runs-on: ubuntu-latest
steps:
- id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.19.3
- run: |
rm -rf out
mkdir out
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --ldflags="-X main.version=${{ steps.get_version.outputs.version }}" -a -o out/knest-linux-amd64 main.go
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build --ldflags="-X main.version=${{ steps.get_version.outputs.version }}" -a -o out/knest-linux-arm64 main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build --ldflags="-X main.version=${{ steps.get_version.outputs.version }}" -a -o out/knest-darwin-amd64 main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build --ldflags="-X main.version=${{ steps.get_version.outputs.version }}" -a -o out/knest-darwin-arm64 main.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build --ldflags="-X main.version=${{ steps.get_version.outputs.version }}" -a -o out/knest-windows-amd64.exe main.go
- uses: softprops/action-gh-release@v1
with:
files: out/*