From 63f60d6da0c671660e20311d35b65fbcf460431f Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Wed, 19 Mar 2025 20:22:47 -0700 Subject: [PATCH 1/8] Try a simple approach to releasing proper version Signed-off-by: James Sturtevant --- RELEASE.md | 4 +++- templates/content/wasi-cli/wasi-cli.csproj | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 4471123..378e21a 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 version `BytecodeAlliance.Componentize.DotNet.Wasm.SDK` package `version` to match the `` i.e. `Version="0.6.0-preview*"` in the [template](./templates/content/wasi-cli/wasi-cli.csproj). 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: 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 @@ - + From 878ea8eee82cedeb43fedaff934a57561b51ddbf Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 13:29:51 -0700 Subject: [PATCH 2/8] use the local pacakge for the test Signed-off-by: James Sturtevant --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fd60f5b..e1f1bfe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,12 +36,15 @@ jobs: run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }} - name: Test Template run: | + artifact_dir=${{ github.workspace }}/artifacts dotnet new install ./artifacts/BytecodeAlliance.Componentize.DotNet.Templates.*.nupkg 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 From 545f314a14f97c4dddb14ee9a2237fca148c1ae7 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 13:46:30 -0700 Subject: [PATCH 3/8] set shell explicitly Signed-off-by: James Sturtevant --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1f1bfe..10ab60f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,14 @@ jobs: run: dotnet test --no-build --verbosity normal - name: Pack run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }} + - name: Ensure package versions match + run: | + ls ./artifacts/*.nupkg + version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=)[^<]+") + echo "Version: $version" + - name: Test Template + shell: bash run: | artifact_dir=${{ github.workspace }}/artifacts dotnet new install ./artifacts/BytecodeAlliance.Componentize.DotNet.Templates.*.nupkg From 1c287c7aa2107c294d613db3ae1f0f74936fc568 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 14:26:11 -0700 Subject: [PATCH 4/8] add a check to make sure the version are moved in lock step Signed-off-by: James Sturtevant --- .github/workflows/build.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10ab60f..46fed4f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,12 +34,17 @@ jobs: run: dotnet test --no-build --verbosity normal - name: Pack run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }} - - name: Ensure package versions match + - name: Ensure package and template versions match + shell: bash run: | ls ./artifacts/*.nupkg - version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=)[^<]+") - echo "Version: $version" - + version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=)[^<]+" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + template_version=$(grep -oPm1 "(?<=Version=\")[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | 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: | From cdfe140def195456af9c2bc8cfc87057cbc70cbe Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 14:32:51 -0700 Subject: [PATCH 5/8] don't use perl syntax Signed-off-by: James Sturtevant --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46fed4f..01da71d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,8 @@ jobs: shell: bash run: | ls ./artifacts/*.nupkg - version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=)[^<]+" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") - template_version=$(grep -oPm1 "(?<=Version=\")[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview") + 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)"; @@ -66,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' }} From f312e7935b7b6ac93d625f74a1c8a30a5be5fdcd Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 14:45:19 -0700 Subject: [PATCH 6/8] Use windows bash compatible envs Signed-off-by: James Sturtevant --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01da71d..6e235f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,10 +48,10 @@ jobs: - name: Test Template shell: bash run: | - artifact_dir=${{ github.workspace }}/artifacts + 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 From f942a6bfc33c4cb5849fc24261acf94926fd3456 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 14:55:20 -0700 Subject: [PATCH 7/8] Update the release readme Signed-off-by: James Sturtevant --- RELEASE.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 378e21a..7f3250e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,8 +2,8 @@ 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) - - the version `BytecodeAlliance.Componentize.DotNet.Wasm.SDK` package `version` to match the `` i.e. `Version="0.6.0-preview*"` in the [template](./templates/content/wasi-cli/wasi-cli.csproj). This ensures the templates use the latest package. + - 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: @@ -15,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 From fa8910e5134603d895b457556d7b23a90e3ec065 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Thu, 20 Mar 2025 14:58:16 -0700 Subject: [PATCH 8/8] Fix typo Signed-off-by: James Sturtevant --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.