Release #9
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: Release | |
on: | |
workflow_dispatch: | |
env: | |
RUST_VERSION: 1.68 | |
jobs: | |
build-native-ubuntu: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
run: | | |
rustup default ${{ env.RUST_VERSION }} | |
- name: Build Rust Project | |
run: cargo build --manifest-path=./rust-bindings/Cargo.toml --release | |
- name: Upload linux library | |
uses: actions/upload-artifact@master | |
with: | |
name: linux-library | |
path: ./rust-bindings/target/release/librust_bindings.so | |
build-native-macos: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
run: | | |
rustup default ${{ env.RUST_VERSION }} | |
- name: Build Rust Project | |
run: cargo build --manifest-path=./rust-bindings/Cargo.toml --release | |
- name: Upload macos library | |
uses: actions/upload-artifact@master | |
with: | |
name: macos-library | |
path: ./rust-bindings/target/release/librust_bindings.dylib | |
build-native-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Rust | |
run: | | |
rustup default ${{ env.RUST_VERSION }} | |
- name: Build Rust Project | |
run: cargo build --manifest-path=./rust-bindings/Cargo.toml --release | |
- name: Upload windows library | |
uses: actions/upload-artifact@master | |
with: | |
name: windows-library | |
path: ./rust-bindings/target/release/rust_bindings.dll | |
build-and-release: | |
needs: [build-native-ubuntu, build-native-macos, build-native-windows] | |
runs-on: ubuntu-20.04 | |
environment: release | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Download linux library | |
uses: actions/download-artifact@master | |
with: | |
name: linux-library | |
path: rust-bindings/target/release | |
- name: Download macos library | |
uses: actions/download-artifact@master | |
with: | |
name: macos-library | |
path: rust-bindings/target/release | |
- name: Download windows library | |
uses: actions/download-artifact@master | |
with: | |
name: windows-library | |
path: rust-bindings/target/release | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Pack | |
run: dotnet pack -c Release -p:RunRustBuild=false -p:IncludeAllRustBuilds=true | |
- name: Upload package for validation | |
uses: actions/upload-artifact@master | |
with: | |
name: package-validation | |
path: ./src/bin/Release | |
- name: Publish to NuGet | |
run: dotnet nuget push "src/bin/Release/ConcordiumNetSdk.*.nupkg" --api-key ${{ secrets.NUGET_APIKEY }} --source https://api.nuget.org/v3/index.json |