Upload package artifact. #18
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: [master] | |
tags-ignore: ['**'] | |
pull_request: | |
workflow_dispatch: | |
env: | |
DOTNET_NOLOGO: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
fail-fast: false | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build Rust | |
run: .\build.ps1 build-rust | |
- name: Upload native artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: native-${{ runner.os }} | |
path: | | |
rust/logoshft/target/win-x64/release/logoshft.dll | |
rust/logoshft/target/linux-x64/release/liblogoshft.so | |
if-no-files-found: error | |
- name: Test Rust | |
run: .\build.ps1 test-rust | |
- name: Restore | |
run: .\build.ps1 restore | |
- name: Build C# | |
run: .\build.ps1 build --skip restore | |
- name: Test C# | |
run: .\build.ps1 test --skip build | |
publish: | |
needs: build | |
if: github.repository_owner == 'LogosBible' && github.ref == 'refs/heads/master' | |
runs-on: windows-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Install .NET | |
uses: actions/setup-dotnet@v3 | |
- name: Download native artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: rust/logoshft/target | |
merge-multiple: true | |
- name: Build and Publish | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: .\build.ps1 publish --platform "Any CPU" | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: release/*.nupkg | |
if-no-files-found: error |