Add darwin back #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Library | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, darwin] | |
goarch: [amd64] | |
include: | |
# - goos: windows | |
# ext: '.dll' | |
- goos: darwin | |
ext: '.dylib' | |
- goos: linux | |
ext: '.so' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Build Library | |
run: | | |
export GOOS=${{ matrix.goos }} | |
export GOARCH=${{ matrix.goarch }} | |
export CGO_ENABLED=1 | |
cd go | |
go mod tidy | |
go build -o sapphirewrapper${{ matrix.ext }} -buildmode=c-shared | |
shell: bash | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sapphirewrapper-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: ./sapphirewrapper${{ matrix.ext }} | |