Skip to content

Merge pull request #43 from ericgregory/readme-nuget #100

Merge pull request #43 from ericgregory/readme-nuget

Merge pull request #43 from ericgregory/readme-nuget #100

Workflow file for this run

# 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: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_call:
jobs:
build:
runs-on: windows-latest
name: Build with Dotnet ${{ matrix.dotnet }}
strategy:
matrix:
dotnet: [ '8.x', '9.0.100-preview.4.24267.66']
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Restore dependencies
run: dotnet restore
- name: Prepare WASM SDKs
run: dotnet msbuild src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets /t:PrepareWasmSdks
- name: Build
run: dotnet build --no-restore /p:BuildNumber=${{ github.run_number }}
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack
run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: artifacts/*.nupkg
if-no-files-found: error
if: ${{ matrix.dotnet == '8.x' }} # only need one package published https://github.com/actions/upload-artifact?tab=readme-ov-file#not-uploading-to-the-same-artifact