-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (30 loc) · 1.14 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
33
34
# workflow name
name: release
# on events
on:
release:
types:
- created
# jobs
jobs:
# generate build cross-platform build files
generate:
name: Generate cross-platform builds
runs-on: ubuntu-latest
steps:
# step 1: checkout repository code
- name: Checkout the repository
uses: actions/checkout@v2
# step 2: generate build files
- name: Generate build files
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/surgecli-linux-amd64 -ldflags="-s -w" surgecli.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o dist/surgecli-darwin-amd64 -ldflags="-s -w" surgecli.go
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/surgecli-windows-amd64.exe -ldflags="-s -w" surgecli.go
# step 3: upload build-artifacts
- name: Upload build-artifacts
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: "./dist/*"