Merge pull request #170 from kelnishi/package-readmes #95
Workflow file for this run
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
| name: Publish Updated Packages to NuGet | |
| on: | |
| push: | |
| tags: | |
| # Existing prefixes (pre-v0.10.0). | |
| - 'WACS-v*.*.*' | |
| - 'WASIp1-v*.*.*' | |
| - 'WACS-Transpiler-v*.*.*' | |
| - 'WACS-WASI-Threads-v*.*.*' | |
| # New prefixes for the v0.10.0 release surface. Related | |
| # packages share a prefix so a single tag publishes the | |
| # group (e.g. WACS-ComponentModel-v0.1.0 publishes both | |
| # the runtime + the bindgen lib). | |
| - 'WACS-Cli-v*.*.*' | |
| - 'WACS-ComponentModel-v*.*.*' | |
| - 'WACS-WASI-Preview2-v*.*.*' | |
| # `WACS-HostBindings-v*` publishes the abstractions package | |
| # + the Roslyn source generator together (both 0.1.0 today). | |
| - 'WACS-HostBindings-v*.*.*' | |
| # `WACS-WASI-NN-v*` publishes the wasi-nn family — the | |
| # backend-agnostic core, the DI bundle (concrete resource | |
| # impls + composite WasiPreview2NNBundle), and the backend | |
| # siblings (ONNX Runtime, ONNX Runtime GenAI, ML.NET, | |
| # LlamaSharp, TorchSharp, OpenVINO). Versioned together | |
| # because the bundle's [WitSource] forwarding properties | |
| # expose interfaces from the core package — a stale core | |
| # breaks the composite. | |
| - 'WACS-WASI-NN-v*.*.*' | |
| # `WACS-WASI-GFX-v*` publishes the wasi-gfx family — the | |
| # backend-agnostic core, the webgpu contract sibling, the | |
| # DI bundle, and the Silk.NET/SDL + wgpu-native backend. | |
| # All four versioned together; the wasi-gfx WIT proposal | |
| # is still at WASI Phase 2 so packages ship -preview. | |
| - 'WACS-WASI-GFX-v*.*.*' | |
| # `WACS-WASI-Preview3-v*` publishes the WASI Preview 3 | |
| # family — host impls (canon-async dispatcher + stream / | |
| # future / error-context handle tables) + the DI sibling. | |
| # Pinned to the wasi-0.3.0-rc-2026-03-15 contract; ships | |
| # alongside the stack-switching substrate. | |
| - 'WACS-WASI-Preview3-v*.*.*' | |
| # `WACS-Harness-v*` publishes the WIT-harness tooling trio: | |
| # the IL emitter (Harness.Lib), the runtime primitives the | |
| # emitted IL calls (Harness.Runtime), and the | |
| # [AsyncComponentHarness] / [AsyncExport] / [SyncExport] | |
| # Roslyn source generator (Async.SourceGen). Each csproj | |
| # carries its own <Version>; --skip-duplicate covers the | |
| # ones that didn't bump. | |
| - 'WACS-Harness-v*.*.*' | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| # Required for NuGet Trusted Publishing via GitHub OIDC. | |
| id-token: write | |
| contents: read | |
| strategy: | |
| matrix: | |
| include: | |
| # Pre-v0.10.0 packages. | |
| - path: Wacs.Core/Wacs.Core | |
| package_name: WACS | |
| tag_prefix: WACS-v | |
| # `WASIp1-v*` publishes the deprecated WACS.WASIp1 | |
| # metapackage AND its successor WACS.WASI.Preview1 | |
| # together (both 0.11.0; both ship in lockstep). The | |
| # metapackage transitively pulls in WACS.WASI.Preview1 | |
| # at restore time, so the two NuGet ids must publish at | |
| # the same version or the metapackage's transitive | |
| # restore breaks. | |
| - path: Wacs.WASI/Wacs.WASI.Preview1/Wacs.WASIp1 | |
| package_name: WACS.WASIp1 | |
| tag_prefix: WASIp1-v | |
| - path: Wacs.WASI/Wacs.WASI.Preview1/Wacs.WASI.Preview1 | |
| package_name: WACS.WASI.Preview1 | |
| tag_prefix: WASIp1-v | |
| - path: Wacs.Transpiler/Wacs.Transpiler | |
| package_name: WACS.Transpiler | |
| tag_prefix: WACS-Transpiler-v | |
| - path: Wacs.Transpiler/Wacs.Transpiler.Lib | |
| package_name: WACS.Transpiler.Lib | |
| tag_prefix: WACS-Transpiler-v | |
| - path: Wacs.WASI/Wacs.WASI.Threads/Wacs.WASI.Threads | |
| package_name: WACS.WASI.Threads | |
| tag_prefix: WACS-WASI-Threads-v | |
| # v0.10.0 release surface. | |
| # `WACS-Cli-v*` → wacs CLI apphost. | |
| - path: Wacs.Console/Wacs.Console | |
| package_name: WACS.Cli | |
| tag_prefix: WACS-Cli-v | |
| # `WACS-ComponentModel-v*` → component-model runtime + | |
| # bindgen library + AOT-safe parser split (the surface | |
| # harness consumers reference under NativeAOT / IL2CPP). | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel | |
| package_name: WACS.ComponentModel | |
| tag_prefix: WACS-ComponentModel-v | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel.Bindgen.Lib | |
| package_name: WACS.ComponentModel.Bindgen.Lib | |
| tag_prefix: WACS-ComponentModel-v | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel.Parser | |
| package_name: WACS.ComponentModel.Parser | |
| tag_prefix: WACS-ComponentModel-v | |
| # `WACS-WASI-Preview2-v*` → typed WASI Preview 2 host | |
| # interfaces + the Microsoft.Extensions.DependencyInjection | |
| # extension (versioned together; both 0.1.0 today). | |
| - path: Wacs.WASI/Wacs.WASI.Preview2/Wacs.WASI.Preview2 | |
| package_name: WACS.WASI.Preview2 | |
| tag_prefix: WACS-WASI-Preview2-v | |
| - path: Wacs.WASI/Wacs.WASI.Preview2/Wacs.WASI.Preview2.DependencyInjection | |
| package_name: WACS.WASI.Preview2.DependencyInjection | |
| tag_prefix: WACS-WASI-Preview2-v | |
| # `WACS-HostBindings-v*` → attribute abstractions + | |
| # Roslyn source generator that wires [WacsImport]-annotated | |
| # host statics to transpiled wasm imports (versioned | |
| # together; both 0.1.0 today). | |
| - path: Wacs.HostBindings/Wacs.HostBindings.Abstractions | |
| package_name: WACS.HostBindings.Abstractions | |
| tag_prefix: WACS-HostBindings-v | |
| - path: Wacs.HostBindings/Wacs.HostBindings.SourceGen | |
| package_name: WACS.HostBindings.SourceGen | |
| tag_prefix: WACS-HostBindings-v | |
| # `WACS-WASI-NN-v*` → wasi-nn family. Backend-agnostic | |
| # core + DI bundle (resource impls + composite | |
| # WasiPreview2NNBundle) + three backends. Each csproj | |
| # carries its own <Version>; the tag value tracks the | |
| # core package's version (the dependency floor for the | |
| # rest). | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN | |
| package_name: WACS.WASI.NN | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.DependencyInjection | |
| package_name: WACS.WASI.NN.DependencyInjection | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.OnnxRuntime | |
| package_name: WACS.WASI.NN.OnnxRuntime | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.MLNet | |
| package_name: WACS.WASI.NN.MLNet | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.LlamaSharp | |
| package_name: WACS.WASI.NN.LlamaSharp | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.TorchSharp | |
| package_name: WACS.WASI.NN.TorchSharp | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.OnnxRuntimeGenAI | |
| package_name: WACS.WASI.NN.OnnxRuntimeGenAI | |
| tag_prefix: WACS-WASI-NN-v | |
| - path: Wacs.WASI/Wacs.WASI.NN/Wacs.WASI.NN.OpenVino | |
| package_name: WACS.WASI.NN.OpenVino | |
| tag_prefix: WACS-WASI-NN-v | |
| # `WACS-WASI-GFX-v*` → wasi-gfx family. Backend-agnostic | |
| # core + webgpu contract sibling + DI bundle + Silk.NET/ | |
| # SDL + wgpu-native backend. Versioned together; the | |
| # csproj versions carry a -preview suffix while the | |
| # upstream wasi-gfx proposal sits at WASI Phase 2. | |
| - path: Wacs.WASI/Wacs.WASI.GFX/Wacs.WASI.GFX | |
| package_name: WACS.WASI.GFX | |
| tag_prefix: WACS-WASI-GFX-v | |
| - path: Wacs.WASI/Wacs.WASI.GFX/Wacs.WASI.GFX.Webgpu | |
| package_name: WACS.WASI.GFX.Webgpu | |
| tag_prefix: WACS-WASI-GFX-v | |
| - path: Wacs.WASI/Wacs.WASI.GFX/Wacs.WASI.GFX.DependencyInjection | |
| package_name: WACS.WASI.GFX.DependencyInjection | |
| tag_prefix: WACS-WASI-GFX-v | |
| - path: Wacs.WASI/Wacs.WASI.GFX/Wacs.WASI.GFX.Silk | |
| package_name: WACS.WASI.GFX.Silk | |
| tag_prefix: WACS-WASI-GFX-v | |
| # `WACS-WASI-Preview3-v*` → WASI Preview 3 family. | |
| # Host impls + DI sibling. Pinned to | |
| # wasi-0.3.0-rc-2026-03-15. | |
| - path: Wacs.WASI/Wacs.WASI.Preview3/Wacs.WASI.Preview3 | |
| package_name: WACS.WASI.Preview3 | |
| tag_prefix: WACS-WASI-Preview3-v | |
| - path: Wacs.WASI/Wacs.WASI.Preview3/Wacs.WASI.Preview3.DependencyInjection | |
| package_name: WACS.WASI.Preview3.DependencyInjection | |
| tag_prefix: WACS-WASI-Preview3-v | |
| # `WACS-Harness-v*` → WIT-harness tooling trio. The IL | |
| # emitter (Harness.Lib) produces typed {World}Harness + | |
| # I{World} assemblies from a WIT directory; the emitted | |
| # IL calls the runtime primitives in Harness.Runtime | |
| # (MemoryHelpers / StringCoding / HarnessLoader.Load / | |
| # Borrowed<T>). The Async.SourceGen Roslyn generator is | |
| # the build-time equivalent of the IL emitter for | |
| # consumers who prefer source-gen over emit-to-.dll. | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel.Harness.Lib | |
| package_name: WACS.ComponentModel.Harness.Lib | |
| tag_prefix: WACS-Harness-v | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel.Harness.Runtime | |
| package_name: WACS.ComponentModel.Harness.Runtime | |
| tag_prefix: WACS-Harness-v | |
| - path: Wacs.ComponentModel/Wacs.ComponentModel.Async.SourceGen | |
| package_name: WACS.ComponentModel.Async.SourceGen | |
| tag_prefix: WACS-Harness-v | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: 'recursive' | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Gate on tag prefix | |
| id: gate | |
| run: | | |
| if [[ "${GITHUB_REF_NAME}" == ${{ matrix.tag_prefix }}* ]]; then | |
| echo "build=true" >> $GITHUB_ENV | |
| else | |
| echo "build=false" >> $GITHUB_ENV | |
| fi | |
| - name: Restore | |
| if: env.build == 'true' | |
| run: dotnet restore ${{ matrix.path }} | |
| - name: Build | |
| if: env.build == 'true' | |
| run: dotnet build ${{ matrix.path }} --configuration Release --no-restore | |
| - name: Pack | |
| if: env.build == 'true' | |
| run: dotnet pack ${{ matrix.path }} --configuration Release --no-build -o output | |
| - name: NuGet Trusted Publishing login | |
| if: env.build == 'true' | |
| id: nuget-login | |
| uses: NuGet/login@v1 | |
| with: | |
| user: kelnishi | |
| - name: Push to NuGet | |
| if: env.build == 'true' | |
| run: dotnet nuget push "output/*.nupkg" --skip-duplicate --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |