diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd60f5b..6e235f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,14 +34,29 @@ jobs: run: dotnet test --no-build --verbosity normal - name: Pack run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }} + - name: Ensure package and template versions match + shell: bash + run: | + ls ./artifacts/*.nupkg + version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oE "[^<]+" | sed 's///' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + template_version=$(grep -oE "Version=\"[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Version="//' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + echo "Package Version: $version | Template version: $template_version" + if [ "$version" != "$template_version" ]; then + echo "Version mismatch: Package version ($version) does not match template version ($template_version)"; + exit 1; + fi - name: Test Template + shell: bash run: | + artifact_dir=$GITHUB_WORKSPACE/artifacts dotnet new install ./artifacts/BytecodeAlliance.Componentize.DotNet.Templates.*.nupkg - mkdir ${{ runner.temp }}/projects - pushd ${{ runner.temp }}/projects + mkdir $RUNNER_TEMP/projects + pushd $RUNNER_TEMP/projects dotnet new componentize.wasi.cli -o test cd test + dotnet nuget add source $artifact_dir dotnet build + dotnet list package popd # must use windows to generate package https://github.com/bytecodealliance/componentize-dotnet/issues/41 # only need one package published https://github.com/actions/upload-artifact?tab=readme-ov-file#not-uploading-to-the-same-artifact @@ -51,5 +66,5 @@ jobs: name: nuget-packages path: artifacts/*.nupkg if-no-files-found: error - if: ${{ matrix.dotnet == '10.x' && matrix.os == 'windows-latest' }} + if: ${{ matrix.dotnet == '10.x' && matrix.os == 'windows-latest' }} diff --git a/README.md b/README.md index 52ff48d..88453d8 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ By default the project will find all wit files and execute wit-bindgen against e ``` -### Configuring location of generaged wit files +### Configuring location of generated wit files By default the wit files are generated under the itermediate path `$(IntermediateOutputPath)wit_bindgen` which is by default at a location like `\obj\Debug\net10.0\wit_bindgen`. This means you can't really see the files and they will be ignored and not checked in to source by default (assuming you have a standard .net `.gitignore`) but intillisense will work. diff --git a/RELEASE.md b/RELEASE.md index 4471123..7f3250e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,9 @@ # Releasing the package 1. Update all the tool versions in [Directory.Build.Props](./Directory.Build.props) -1. Open a PR to update the `` tag in [Directory.Build.Props](./Directory.Build.props) +1. Open a PR to update: + - the `` tag in [Directory.Build.Props](./Directory.Build.props) + - the `BytecodeAlliance.Componentize.DotNet.Wasm.SDK` package `version` to match the `` in the [template](./templates/content/wasi-cli/wasi-cli.csproj). For example the template version might look like `Version="0.6.0-preview*"`. This ensures the templates use the latest package. 1. Maintainers approve and merge PR 1. After the PR merges a maintainer triggers the Release workflow on the main branch via the github Actions UI or runs: @@ -13,9 +15,14 @@ gh workflow run build -f test-run=false 5. Maintainer updates release notes with package info: ``` +# https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.Templates +dotnet new install BytecodeAlliance.Componentize.DotNet.Templates + # https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.Wasm.SDK dotnet add package BytecodeAlliance.Componentize.DotNet.Wasm.SDK # https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.WitBindgen dotnet add package BytecodeAlliance.Componentize.DotNet.WitBindgen -``` \ No newline at end of file +``` + +6. Post message about release [c# collaboration Zulip channel](https://bytecodealliance.zulipchat.com/#narrow/channel/407028-C.23.2F.2Enet-collaboration) \ No newline at end of file diff --git a/templates/content/wasi-cli/wasi-cli.csproj b/templates/content/wasi-cli/wasi-cli.csproj index 77fabe3..189aa8e 100644 --- a/templates/content/wasi-cli/wasi-cli.csproj +++ b/templates/content/wasi-cli/wasi-cli.csproj @@ -14,7 +14,7 @@ - +