Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit 98d2790

Browse files
committed
feat: add darwin builds
1 parent 492fb01 commit 98d2790

File tree

1 file changed

+57
-11
lines changed

1 file changed

+57
-11
lines changed

.github/workflows/build.yml

+57-11
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ on:
99
pull_request:
1010
branches:
1111
- main
12-
release:
13-
types:
14-
- published
1512

1613
jobs:
1714
build_linux:
@@ -26,12 +23,12 @@ jobs:
2623
env:
2724
GOOS: "linux"
2825
GOARCH: "amd64"
29-
run: go build -o build/monstercat main.go
26+
run: go build -o build/monstercat_linux_amd64 main.go
3027
- name: store binary
3128
uses: actions/upload-artifact@v2
3229
with:
3330
name: linux
34-
path: build/monstercat
31+
path: build/
3532
build_windows:
3633
runs-on: ubuntu-latest
3734
steps:
@@ -44,15 +41,51 @@ jobs:
4441
env:
4542
GOOS: "windows"
4643
GOARCH: "amd64"
47-
run: go build -o build/monstercat.exe main.go
44+
run: go build -o build/monstercat_windows_amd64.exe main.go
4845
- name: store binary
4946
uses: actions/upload-artifact@v2
5047
with:
5148
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/
5386
release:
5487
runs-on: ubuntu-latest
55-
needs: [build_linux, build_windows]
88+
needs: [build_linux, build_windows, build_darwin_amd64, build_darwin_arm64]
5689
if: startsWith(github.ref, 'refs/tags/')
5790
steps:
5891
- name: download linux binary
@@ -65,8 +98,21 @@ jobs:
6598
with:
6699
name: windows
67100
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
69113
with:
70114
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

Comments
 (0)