8
8
name : build binaries
9
9
runs-on : ubuntu-latest
10
10
steps :
11
+ - name : Branch name
12
+ id : branch_name
13
+ run : |
14
+ SOURCE_TAG=${GITHUB_REF#refs/tags/} # Get tag
15
+ echo ::set-output name=SOURCE_TAG::$SOURCE_TAG
11
16
- name : Install Go
12
17
uses : actions/setup-go@v2
13
18
with :
14
- go-version : 1.15 .x
19
+ go-version : 1.16 .x
15
20
- name : Checkout code
16
21
uses : actions/checkout@v2
17
22
- name : Build code
18
23
run : |
19
- echo "GO111MODULE=on" >> $GITHUB_ENV
20
- mkdir bin
21
- GOOS=windows GOARCH=amd64 go build -o bin/inmap-windows-amd64.exe
22
- GOOS=linux GOARCH=amd64 go build -o bin/inmap-linux-amd64
23
- GOOS=darwin GOARCH=amd64 go build -o bin/inmap-darwin-amd64
24
- GOOS=darwin GOARCH=arm64 go build -o bin/inmap-darwin-arm64
25
- - name : upload artifacts
26
- uses : actions/upload-artifact@v2
27
- with :
28
- name : binaries
29
- path : bin/
30
- if-no-files-found : error
31
-
32
- upload :
33
- name : Upload release assets
34
- runs-on : ubuntu-latest
35
- needs : [build]
36
- steps :
37
- - name : Branch name
38
- id : branch_name
39
- run : |
40
- echo ::set-output name=SOURCE_NAME::${GITHUB_REF#refs/*/}
41
- echo ::set-output name=SOURCE_BRANCH::${GITHUB_REF#refs/heads/}
42
- echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
43
- - name : Checkout code
44
- uses : actions/checkout@v1
45
-
46
- - name : Download build artefacts
47
- uses : actions/download-artifact@v2
48
- with :
49
- name : binaries
50
- path : bin/
51
-
52
- - name : Create asset zips
24
+ ./.github/build.sh
53
25
env :
54
26
SOURCE_TAG : ${{ steps.branch_name.outputs.SOURCE_TAG }}
55
- run : |
56
- mkdir assets
57
- zip assets/inmap-${SOURCE_TAG}-windows-amd64.exe bin/inmap-windows-amd64.exe
58
- zip assets/inmap-${SOURCE_TAG}-linux-amd64 bin/inmap-linux-amd64
59
- zip assets/inmap-${SOURCE_TAG}-darwin-amd64 bin/inmap-darwin-amd64
60
- zip assets/inmap-${SOURCE_TAG}-darwin-arm64 bin/inmap-darwin-arm64
61
- sha256sum assets/* > assets/SHASUMS256.txt
62
- - name : Upload release assets
27
+ - name : Upload the artifacts
63
28
uses : skx/github-action-publish-binaries@master
64
29
env :
65
30
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66
31
with :
67
- args : ' ./assets/ *'
32
+ args : ' inmap- *'
0 commit comments