c-kzg-4844/.github/workflows/cross-compile.yml

82 lines
2.6 KiB
YAML

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:
- uses: ilammy/msvc-dev-cmd@v1
- 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 }}
path: bindings/csharp/Ckzg.Bindings/runtimes/${{ matrix.target.native }}/native
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
path: bindings/csharp/Ckzg.Bindings/runtimes/linux-x64/native
- uses: actions/download-artifact@v3
with:
name: ckzg-library-osx-x64
path: bindings/csharp/Ckzg.Bindings/runtimes/osx-x64/native
- uses: actions/download-artifact@v3
with:
name: ckzg-library-win-x64
path: bindings/csharp/Ckzg.Bindings/runtimes/win-x64/native
- uses: actions/download-artifact@v3
with:
name: ckzg-library-osx-arm64
path: bindings/csharp/Ckzg.Bindings/runtimes/osx-arm64/native
- uses: actions/download-artifact@v3
with:
name: ckzg-library-linux-arm64
path: bindings/csharp/Ckzg.Bindings/runtimes/linux-arm64/native
- 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:
name: Ckzg.Bindings
path: bindings/csharp/build/Ckzg.Bindings.*.nupkg