Build Worker Native Libs #6
Workflow file for this run
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 Worker Native Libs | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: Version number (package) | |
permissions: | |
contents: write | |
jobs: | |
build-macos: | |
name: Build (macOS Universal) | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: chmod +x ./native/nuget/scripts/build_macos.sh && ./native/nuget/scripts/build_macos.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macos | |
path: native/src/target/universal-release/*.dylib | |
build-windows: | |
name: Build (Windows ${{ matrix.arch }}) | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare Build Target | |
run: rustup target add ${{ matrix.arch }}-pc-windows-msvc | |
- name: Build | |
run: cargo build --release --target ${{ matrix.arch }}-pc-windows-msvc | |
working-directory: native/src | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-${{ matrix.arch }} | |
path: native/src/target/${{ matrix.arch }}-pc-windows-msvc/release/*.dll | |
build-linux: | |
name: Build (Linux ${{ matrix.arch }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [ x86_64, aarch64 ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Cross | |
run: cargo install cross --git https://github.com/cross-rs/cross | |
- name: Build | |
run: cross build --release --target ${{ matrix.arch }}-unknown-linux-gnu | |
working-directory: native/src | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-${{ matrix.arch }} | |
path: native/src/target/${{ matrix.arch }}-unknown-linux-gnu/release/*.so | |
publish-package: | |
name: Publish Package | |
runs-on: ubuntu-latest | |
needs: | |
- build-windows | |
- build-macos | |
- build-linux | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: macos | |
path: native/nuget/runtimes/osx/native | |
- uses: actions/download-artifact@v3 | |
with: | |
name: windows-x86_64 | |
path: native/nuget/runtimes/win-x64/native | |
- uses: actions/download-artifact@v3 | |
with: | |
name: windows-aarch64 | |
path: native/nuget/runtimes/win-arm64/native | |
- uses: actions/download-artifact@v3 | |
with: | |
name: linux-x86_64 | |
path: native/nuget/runtimes/linux-x64/native | |
- uses: actions/download-artifact@v3 | |
with: | |
name: linux-aarch64 | |
path: native/nuget/runtimes/linux-arm64/native | |
- name: Build Package | |
run: dotnet pack -c Release -p:Version=${{ github.ref_name }} -o ./packages native/nuget | |
- name: Publish Package | |
run: dotnet nuget push -s https://nuget.pkg.github.com/dragonfruitnetwork/index.json -k ${{ github.token }} ./packages/*.nupkg |