9
9
pull_request :
10
10
branches :
11
11
- main
12
- release :
13
- types :
14
- - published
15
12
16
13
jobs :
17
14
build_linux :
@@ -26,12 +23,12 @@ jobs:
26
23
env :
27
24
GOOS : " linux"
28
25
GOARCH : " amd64"
29
- run : go build -o build/monstercat main.go
26
+ run : go build -o build/monstercat_linux_amd64 main.go
30
27
- name : store binary
31
28
uses : actions/upload-artifact@v2
32
29
with :
33
30
name : linux
34
- path : build/monstercat
31
+ path : build/
35
32
build_windows :
36
33
runs-on : ubuntu-latest
37
34
steps :
@@ -44,15 +41,51 @@ jobs:
44
41
env :
45
42
GOOS : " windows"
46
43
GOARCH : " amd64"
47
- run : go build -o build/monstercat .exe main.go
44
+ run : go build -o build/monstercat_windows_amd64 .exe main.go
48
45
- name : store binary
49
46
uses : actions/upload-artifact@v2
50
47
with :
51
48
name : windows
52
- path : build/monstercat.exe
49
+ path : build/
50
+ build_darwin_amd64 :
51
+ runs-on : ubuntu-latest
52
+ steps :
53
+ - uses : actions/checkout@v2
54
+ - name : setup golang
55
+ uses : actions/setup-go@v2
56
+ with :
57
+ go-version : 1.17
58
+ - name : build project
59
+ env :
60
+ GOOS : " darwin"
61
+ GOARCH : " amd64"
62
+ run : go build -o build/monstercat_darwin_amd64 main.go
63
+ - name : store binary
64
+ uses : actions/upload-artifact@v2
65
+ with :
66
+ name : darwin_amd64
67
+ path : build/
68
+ build_darwin_arm64 :
69
+ runs-on : ubuntu-latest
70
+ steps :
71
+ - uses : actions/checkout@v2
72
+ - name : setup golang
73
+ uses : actions/setup-go@v2
74
+ with :
75
+ go-version : 1.17
76
+ - name : build project
77
+ env :
78
+ GOOS : " darwin"
79
+ GOARCH : " arm64"
80
+ run : go build -o build/monstercat_darwin_arm64 main.go
81
+ - name : store binary
82
+ uses : actions/upload-artifact@v2
83
+ with :
84
+ name : darwin_arm64
85
+ path : build/
53
86
release :
54
87
runs-on : ubuntu-latest
55
- needs : [build_linux, build_windows]
88
+ needs : [build_linux, build_windows, build_darwin_amd64, build_darwin_arm64 ]
56
89
if : startsWith(github.ref, 'refs/tags/')
57
90
steps :
58
91
- name : download linux binary
65
98
with :
66
99
name : windows
67
100
path : windows/
68
- - uses : softprops/action-gh-release@v1
101
+ - name : download darwin amd64 binary
102
+ uses : actions/download-artifact@v2
103
+ with :
104
+ name : darwin_amd64
105
+ path : darwin_amd64/
106
+ - name : download darwin arm64 binary
107
+ uses : actions/download-artifact@v2
108
+ with :
109
+ name : darwin_arm64
110
+ path : darwin_arm64/
111
+ - name : upload artifacts to release
112
+ uses : softprops/action-gh-release@v1
69
113
with :
70
114
files : |
71
- linux/monstercat
72
- windows/monstercat.exe
115
+ linux/monstercat_linux_amd64
116
+ windows/monstercat_windows_amd64.exe
117
+ darwin_amd64/monstercat_darwin_amd64
118
+ darwin_arm64/monstercat_darwin_arm64
0 commit comments