Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #64
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 & test | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: | |
- published | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
test_nuget: | |
name: Test NuGet package on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Test | |
run: dotnet test dotnet/tests/Spreads.Native.Tests.NuGet/Spreads.Native.Tests.NuGet.csproj -c Release --verbosity normal | |
native_build_macos: | |
name: Native build macOS | |
runs-on: macos-latest | |
defaults: | |
run: | |
working-directory: rs | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: cargo build --release | |
- name: Run tests | |
run: cargo test --all --release | |
- name: Upload Native Lib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libspreads_native.dylib | |
path: rs/target/release/libspreads_native.dylib | |
native_build_linux: | |
name: Native build Linux | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: rs | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: cargo build --release | |
- name: Run tests | |
run: cargo test --all --release | |
- name: Upload Native Lib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: libspreads_native.so | |
path: rs/target/release/libspreads_native.so | |
native_build_windows: | |
name: Native build Windows | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: rs | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Build | |
run: cargo build --release | |
- name: Run tests | |
run: cargo test --all --release | |
- name: Upload Native Lib | |
uses: actions/upload-artifact@v3 | |
with: | |
name: spreads_native.dll | |
path: rs/target/release/spreads_native.dll | |
dotnet_build: | |
name: Dotnet build Windows | |
runs-on: windows-latest | |
needs: | |
- native_build_macos | |
- native_build_linux | |
- native_build_windows | |
defaults: | |
run: | |
working-directory: dotnet | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET Core 6 | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: Download macOS Lib | |
uses: actions/[email protected] | |
with: | |
name: libspreads_native.dylib | |
path: dotnet/lib/runtimes/osx-x64/native | |
- name: Download Linux Lib | |
uses: actions/[email protected] | |
with: | |
name: libspreads_native.so | |
path: dotnet/lib/runtimes/linux-x64/native | |
- name: Download Windows Lib | |
uses: actions/[email protected] | |
with: | |
name: spreads_native.dll | |
path: dotnet/lib/runtimes/win-x64/native | |
- name: Delete Native Lib Artifacts | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: | | |
libspreads_native.dylib | |
libspreads_native.so | |
spreads_native.dll | |
failOnError: false | |
- name: Restore Spreads.Native | |
run: dotnet restore src/Spreads.Native/Spreads.Native.csproj | |
- name: Build Spreads.Native | |
run: dotnet build src/Spreads.Native/Spreads.Native.csproj -c Release | |
- name: Restore Spreads.Native.Tests project | |
run: dotnet restore tests/Spreads.Native.Tests/Spreads.Native.Tests.csproj | |
- name: Build Spreads.Native.Tests project | |
run: dotnet build tests/Spreads.Native.Tests/Spreads.Native.Tests.csproj -c Release | |
- name: Run Spreads.Native.Tests | |
run: dotnet test tests/Spreads.Native.Tests/Spreads.Native.Tests.csproj -c Release --verbosity normal | |
- name: Pack Spreads.Native NuGet | |
run: dotnet pack src\Spreads.Native\Spreads.Native.csproj --no-restore --no-build -c Release -o artifacts -p:BuildSuffix=False | |
- name: Upload NuGet artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: NuGet | |
path: dotnet/artifacts/*.nupkg | |
- name: Publish NuGet | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
if: github.event_name == 'release' | |
run: dotnet nuget push artifacts/**/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols --api-key "$env:NUGET_API_KEY" | |