Skip to content

Commit d1cc3aa

Browse files
authored
Build releases for MacOS (both Intel & Apple Silicon) (#77)
1 parent 9d46c77 commit d1cc3aa

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ jobs:
2727
-o "storage-cli-linux-arm64"
2828
sha1sum "storage-cli-linux-arm64"
2929
30+
- name: Storage-CLI Build for macOS
31+
run: |
32+
echo "Building Storage CLI for macOS"
33+
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=0.0.0" \
34+
-o "storage-cli-darwin-amd64"
35+
sha1sum "storage-cli-darwin-amd64"
36+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.version=0.0.0" \
37+
-o "storage-cli-darwin-arm64"
38+
sha1sum "storage-cli-darwin-arm64"
39+
3040
- name: Storage-CLI Build for Windows
3141
run: |
3242
echo "Building Storage CLI for Windows"
@@ -48,5 +58,7 @@ jobs:
4858
path: |
4959
storage-cli-linux-amd64
5060
storage-cli-linux-arm64
61+
storage-cli-darwin-amd64
62+
storage-cli-darwin-arm64
5163
storage-cli-windows-amd64.exe
5264
retention-days: 30

.github/workflows/release-manual.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,22 @@ jobs:
9191
sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-arm64" >> $GITHUB_STEP_SUMMARY
9292
echo '```' >> $GITHUB_STEP_SUMMARY
9393
94+
- name: Build for macOS
95+
run: |
96+
echo "Building Storage CLI for macOS"
97+
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \
98+
-o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64"
99+
echo "### macOS amd64 Build Checksums" >> $GITHUB_STEP_SUMMARY
100+
echo '```' >> $GITHUB_STEP_SUMMARY
101+
sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64" >> $GITHUB_STEP_SUMMARY
102+
echo '```' >> $GITHUB_STEP_SUMMARY
103+
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -ldflags "-X main.version=${{ steps.version.outputs.VERSION_NUMBER }}" \
104+
-o "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64"
105+
echo "### macOS arm64 Build Checksums" >> $GITHUB_STEP_SUMMARY
106+
echo '```' >> $GITHUB_STEP_SUMMARY
107+
sha1sum "storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64" >> $GITHUB_STEP_SUMMARY
108+
echo '```' >> $GITHUB_STEP_SUMMARY
109+
94110
- name: Build for Windows
95111
run: |
96112
echo "Building Storage CLI for Windows"
@@ -110,6 +126,8 @@ jobs:
110126
artifacts: |
111127
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-amd64
112128
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-linux-arm64
129+
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-amd64
130+
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-darwin-arm64
113131
storage-cli-${{ steps.version.outputs.VERSION_NUMBER }}-windows-amd64.exe
114132
token: ${{ secrets.GITHUB_TOKEN }}
115133
allowUpdates: true

0 commit comments

Comments
 (0)