RSA (#181) #108
This file contains hidden or 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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET Nuget Publish | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| native-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust (Windows) | |
| working-directory: cas-core-lib | |
| run: cargo build --release | |
| - name: Stage native | |
| run: | | |
| mkdir cas-dotnet-sdk\artifacts\native\win-x64 | |
| copy cas-core-lib\target\release\cas_core_lib.dll cas-dotnet-sdk\artifacts\native\win-x64\ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-win | |
| path: cas-dotnet-sdk/artifacts/native/win-x64 | |
| native-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build Rust (Linux) | |
| working-directory: cas-core-lib | |
| run: cargo build --release | |
| - name: Stage native | |
| run: | | |
| mkdir -p cas-dotnet-sdk/artifacts/native/linux-x64 | |
| cp cas-core-lib/target/release/libcas_core_lib.so cas-dotnet-sdk/artifacts/native/linux-x64/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-linux | |
| path: cas-dotnet-sdk/artifacts/native/linux-x64 | |
| pack-and-publish: | |
| runs-on: ubuntu-latest | |
| needs: [native-windows, native-linux] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: native-win | |
| path: cas-dotnet-sdk/artifacts/native/win-x64 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: native-linux | |
| path: cas-dotnet-sdk/artifacts/native/linux-x64 | |
| - name: Verify staged natives | |
| run: | | |
| ls -R cas-dotnet-sdk/artifacts/native | |
| test -f cas-dotnet-sdk/artifacts/native/linux-x64/libcas_core_lib.so | |
| test -f cas-dotnet-sdk/artifacts/native/win-x64/cas_core_lib.dll | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Build (managed) | |
| working-directory: cas-dotnet-sdk | |
| run: dotnet build -c Release -p:BuildNativeRust=false | |
| - name: Publish to NuGet | |
| run: dotnet nuget push cas-dotnet-sdk/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |