2022-11-03 13:08:17 +00:00
|
|
|
name: Cross Compile
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-ckzg:
|
|
|
|
runs-on: ${{ matrix.target.host }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- clang: x86_64-linux
|
|
|
|
native: linux-x64
|
|
|
|
host: ubuntu-latest
|
|
|
|
#- clang: arm64-linux
|
|
|
|
# native: linux-arm64
|
|
|
|
# host: ubuntu-latest
|
|
|
|
#- clang: arm64-darwin
|
|
|
|
# native: osx-arm64
|
|
|
|
# host: macos-latest
|
|
|
|
- clang: x86_64-darwin
|
|
|
|
native: osx-x64
|
|
|
|
host: macos-latest
|
|
|
|
- clang: x86_64-win
|
|
|
|
native: win-x64
|
|
|
|
host: windows-latest
|
|
|
|
steps:
|
2022-11-07 16:50:32 +00:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
2022-11-03 13:08:17 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
- name: Build native library for ${{ matrix.target.native }}
|
|
|
|
run: cd bindings/csharp && make -B ckzg CSHARP_PLATFORM=${{ matrix.target.native }} CLANG_PLATFORM=${{ matrix.target.clang }}
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ckzg-library-${{ matrix.target.native }}
|
2022-11-07 16:50:32 +00:00
|
|
|
path: bindings/csharp/Ckzg.Bindings/runtimes/${{ matrix.target.native }}/native
|
2022-11-03 13:08:17 +00:00
|
|
|
|
|
|
|
build-ckzg-dotnet:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-ckzg
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ckzg-library-linux-x64
|
2022-11-07 16:50:32 +00:00
|
|
|
path: bindings/csharp/Ckzg.Bindings/runtimes/linux-x64/native
|
2022-11-03 13:08:17 +00:00
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ckzg-library-osx-x64
|
2022-11-07 16:50:32 +00:00
|
|
|
path: bindings/csharp/Ckzg.Bindings/runtimes/osx-x64/native
|
2022-11-03 13:08:17 +00:00
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ckzg-library-win-x64
|
2022-11-07 16:50:32 +00:00
|
|
|
path: bindings/csharp/Ckzg.Bindings/runtimes/win-x64/native
|
2022-11-03 13:08:17 +00:00
|
|
|
|
|
|
|
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
|
|
|
|
uses: actions/setup-dotnet@v3
|
|
|
|
with:
|
|
|
|
dotnet-version: ${{ matrix.dotnet-version }}
|
|
|
|
- name: Install dependencies
|
|
|
|
run: cd bindings/csharp && dotnet restore
|
|
|
|
- name: Build
|
|
|
|
run: cd bindings/csharp && dotnet build --configuration Release --no-restore -o build
|
|
|
|
- name: Upload package
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2022-11-07 16:50:32 +00:00
|
|
|
name: Ckzg.Bindings.nuget
|
2022-11-09 19:27:09 +00:00
|
|
|
path: bindings/csharp/build/Ckzg.Bindings.*.nupkg
|