-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (39 loc) · 1.38 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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