Skip to content

Commit

Permalink
feat: build multi-architecture binary (#6)
Browse files Browse the repository at this point in the history
* feat: build multi-architecture binary

* Not linting at the moment
  • Loading branch information
2ndalpha authored Oct 24, 2023
1 parent e7d5bf7 commit 0a2c47f
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
- pull_request

name: Test

jobs:
test:
name: Test
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.19

- name: download deps
run: go get .

- name: Test
run: go test

build-binary:
name: Build multi-architecture binary
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.19

- name: download deps
run: go get .

- name: Build
run: ./build.sh
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e

GOOS=darwin GOARCH=amd64 go build -o gradle-subproject-resolver-amd64 *.go
GOOS=darwin GOARCH=arm64 go build -o gradle-subproject-resolver-arm64 *.go
lipo -create -output gradle-subproject-resolver gradle-subproject-resolver-amd64 gradle-subproject-resolver-arm64

rm -f gradle-subproject-resolver-amd64 gradle-subproject-resolver-arm64

0 comments on commit 0a2c47f

Please sign in to comment.