Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
8: Arm64 based macOS Support
Browse files Browse the repository at this point in the history
  • Loading branch information
yunussandikci authored Dec 2, 2020
1 parent 953c1de commit ce14836
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ jobs:
exclude:
- goos: darwin
goarch: arm
- goos: darwin
goarch: arm64
- goos: windows
goarch: arm64
include:
Expand All @@ -68,12 +66,28 @@ jobs:
- name: Download Dependencies
run: go mod download

- name: Build ${{ matrix.os }}
- name: Build on ${{ matrix.os }}
if: ${{ matrix.goos != 'darwin' || matrix.goarch != 'arm64' }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: go build -ldflags "-w -s -X github.com/${{ env.organization }}/hazelcast-cloud-cli/internal.Version=${{ needs.release.outputs.version }} -X github.com/${{ env.organization }}/hazelcast-cloud-cli/internal.Distribution=DIRECT" -o hzcloud-${{ matrix.GOOS }}-${{ matrix.GOARCH }}

- name: Build for macos-arm64
if: ${{ matrix.goos == 'darwin' && matrix.goarch == 'arm64' }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
SDK_PATH: "/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk"
run: |
CC="$(xcrun -sdk $SDK_PATH --find clang) -arch $GOARCH -isysroot $SDK_PATH" \
CFLAGS="-isysroot $SDK_PATH -arch $GOARCH -I$SDK_PATH/usr/include" \
LD_LIBRARY_PATH="$SDK_PATH/usr/lib" \
CGO_ENABLED=1 \
CGO_CFLAGS="-isysroot $SDK_PATH -arch $GOARCH" \
CGO_LDFLAGS="-isysroot $SDK_PATH -arch $GOARCH" \
go build -ldflags "-w -s -X github.com/${{ env.organization }}/hazelcast-cloud-cli/internal.Version=${{ needs.release.outputs.version }} -X github.com/${{ env.organization }}/hazelcast-cloud-cli/internal.Distribution=DIRECT" -o hzcloud-${{ matrix.goos }}-${{ matrix.GOARCH }}
- name: Upload ${{ matrix.os }} Binary
uses: actions/upload-release-asset@v1.0.1
env:
Expand Down

0 comments on commit ce14836

Please sign in to comment.