Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try a simple approach to releasing proper version in templates #83

Merged
merged 8 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<version>[^<]+" | sed 's/<version>//' | 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
Expand All @@ -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' }}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ By default the project will find all wit files and execute wit-bindgen against e
</ItemGroup>
```

### 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.

Expand Down
11 changes: 9 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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 `<VersionPrefix>` tag in [Directory.Build.Props](./Directory.Build.props)
1. Open a PR to update:
- the `<VersionPrefix>` tag in [Directory.Build.Props](./Directory.Build.props)
- the `BytecodeAlliance.Componentize.DotNet.Wasm.SDK` package `version` to match the `<VersionPrefix>` 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:

Expand All @@ -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
```
```

6. Post message about release [c# collaboration Zulip channel](https://bytecodealliance.zulipchat.com/#narrow/channel/407028-C.23.2F.2Enet-collaboration)
2 changes: 1 addition & 1 deletion templates/content/wasi-cli/wasi-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.6.0-preview00009" />
<PackageReference Include="BytecodeAlliance.Componentize.DotNet.Wasm.SDK" Version="0.6.0-preview*" />
<PackageReference Condition="'$(platform)' == 'Windows_NT'" Include="runtime.win-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25162.1" />
<PackageReference Condition="'$(platform)' == 'linux'" Include="runtime.linux-x64.microsoft.dotnet.ilcompiler.llvm" Version="10.0.0-alpha.1.25162.1" />
</ItemGroup>
Expand Down