Skip to content

Building takes too much time #13

Building takes too much time

Building takes too much time #13

Workflow file for this run

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@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: ./sapphirewrapper${{ matrix.ext }}