Fix path #15
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' | |
CC: o64-clang | |
CXX: o64-clang++ | |
- goos: linux | |
ext: '.so' | |
CC: gcc | |
CXX: g++ | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
- name: Setup osxcross (for darwin builds only) | |
if: matrix.goos == 'darwin' | |
uses: mbround18/setup-osxcross@v1 | |
with: | |
osx-version: "12.3" | |
- name: Build Library | |
run: | | |
export GOOS=${{ matrix.goos }} | |
export GOARCH=${{ matrix.goarch }} | |
export CC=${{ matrix.CC }} | |
export CXX=${{ matrix.CXX }} | |
export CGO_ENABLED=1 | |
export PATH="$(pwd)/osxcross/target/bin:$PATH" | |
cd go | |
go mod tidy | |
go build -o sapphirewrapper${{ matrix.ext }} -buildmode=c-shared | |
shell: bash | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sapphirewrapper-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: ./go/sapphirewrapper${{ matrix.ext }} | |