Update #138
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 | |
on: | |
push: | |
branches: ["*"] | |
tags-ignore: ["v*"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build-runtime-package: | |
strategy: | |
matrix: | |
rid: | |
[ | |
linux-x64, | |
linux-arm64, | |
osx-arm64, | |
osx-x64, | |
win-arm64, | |
win-x64, | |
win-x86, | |
] | |
include: | |
- { os: ubuntu-latest, rid: linux-x64 } | |
- { os: ubuntu-latest, rid: linux-arm64 } | |
- { os: ubuntu-latest, rid: osx-arm64 } | |
- { os: ubuntu-latest, rid: osx-x64 } | |
- { os: ubuntu-latest, rid: win-arm64 } | |
- { os: ubuntu-latest, rid: win-x64 } | |
- { os: ubuntu-latest, rid: win-x86 } | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: "true" | |
fetch-depth: 0 | |
- name: Install .NET Sdk | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: global.json | |
- name: Do pack | |
run: | | |
dotnet build native/native.csproj -p:Configuration=Release -p:RuntimeIdentifier=${{ matrix.rid }} | |
dotnet pack native/NativeLibrary.runtime.csproj -p:RuntimeIdentifier=${{ matrix.rid }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: "nupkgs" | |
build-main-package: | |
needs: build-runtime-package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET Sdk | |
uses: actions/setup-dotnet@v3 | |
with: | |
global-json-file: global.json | |
- uses: actions/download-artifact@v3 | |
with: | |
name: Artifacts | |
path: "nupkgs" | |
- name: Do pack | |
run: | | |
dotnet pack native/NativeLibrary.csproj | |
dotnet pack | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Artifacts | |
path: "nupkgs" |