Skip to content

Commit db099df

Browse files
authored
Merge pull request #83 from jsturtevant/fix-template-deploy
Try a simple approach to releasing proper version in templates
2 parents 6a0e343 + fa8910e commit db099df

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

.github/workflows/build.yml

+18-3
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,29 @@ jobs:
3434
run: dotnet test --no-build --verbosity normal
3535
- name: Pack
3636
run: dotnet pack -c Release /p:BuildNumber=${{ github.run_number }}
37+
- name: Ensure package and template versions match
38+
shell: bash
39+
run: |
40+
ls ./artifacts/*.nupkg
41+
version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oE "<version>[^<]+" | sed 's/<version>//' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview")
42+
template_version=$(grep -oE "Version=\"[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | sed 's/Version="//' | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview")
43+
echo "Package Version: $version | Template version: $template_version"
44+
if [ "$version" != "$template_version" ]; then
45+
echo "Version mismatch: Package version ($version) does not match template version ($template_version)";
46+
exit 1;
47+
fi
3748
- name: Test Template
49+
shell: bash
3850
run: |
51+
artifact_dir=$GITHUB_WORKSPACE/artifacts
3952
dotnet new install ./artifacts/BytecodeAlliance.Componentize.DotNet.Templates.*.nupkg
40-
mkdir ${{ runner.temp }}/projects
41-
pushd ${{ runner.temp }}/projects
53+
mkdir $RUNNER_TEMP/projects
54+
pushd $RUNNER_TEMP/projects
4255
dotnet new componentize.wasi.cli -o test
4356
cd test
57+
dotnet nuget add source $artifact_dir
4458
dotnet build
59+
dotnet list package
4560
popd
4661
# must use windows to generate package https://github.com/bytecodealliance/componentize-dotnet/issues/41
4762
# 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:
5166
name: nuget-packages
5267
path: artifacts/*.nupkg
5368
if-no-files-found: error
54-
if: ${{ matrix.dotnet == '10.x' && matrix.os == 'windows-latest' }}
69+
if: ${{ matrix.dotnet == '10.x' && matrix.os == 'windows-latest' }}
5570

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ By default the project will find all wit files and execute wit-bindgen against e
198198
</ItemGroup>
199199
```
200200

201-
### Configuring location of generaged wit files
201+
### Configuring location of generated wit files
202202

203203
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.
204204

RELEASE.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Releasing the package
22

33
1. Update all the tool versions in [Directory.Build.Props](./Directory.Build.props)
4-
1. Open a PR to update the `<VersionPrefix>` tag in [Directory.Build.Props](./Directory.Build.props)
4+
1. Open a PR to update:
5+
- the `<VersionPrefix>` tag in [Directory.Build.Props](./Directory.Build.props)
6+
- 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.
57
1. Maintainers approve and merge PR
68
1. After the PR merges a maintainer triggers the Release workflow on the main branch via the github Actions UI or runs:
79

@@ -13,9 +15,14 @@ gh workflow run build -f test-run=false
1315
5. Maintainer updates release notes with package info:
1416

1517
```
18+
# https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.Templates
19+
dotnet new install BytecodeAlliance.Componentize.DotNet.Templates
20+
1621
# https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.Wasm.SDK
1722
dotnet add package BytecodeAlliance.Componentize.DotNet.Wasm.SDK
1823
1924
# https://www.nuget.org/packages/BytecodeAlliance.Componentize.DotNet.WitBindgen
2025
dotnet add package BytecodeAlliance.Componentize.DotNet.WitBindgen
21-
```
26+
```
27+
28+
6. Post message about release [c# collaboration Zulip channel](https://bytecodealliance.zulipchat.com/#narrow/channel/407028-C.23.2F.2Enet-collaboration)

templates/content/wasi-cli/wasi-cli.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

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

0 commit comments

Comments
 (0)