Skip to content

Commit 1c287c7

Browse files
committed
add a check to make sure the version are moved in lock step
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 545f314 commit 1c287c7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ 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 versions match
37+
- name: Ensure package and template versions match
38+
shell: bash
3839
run: |
3940
ls ./artifacts/*.nupkg
40-
version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=<version>)[^<]+")
41-
echo "Version: $version"
42-
41+
version=$(unzip -p ./artifacts/*SDK*.nupkg '*.nuspec' | grep -oPm1 "(?<=<version>)[^<]+" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+-preview")
42+
template_version=$(grep -oPm1 "(?<=Version=\")[^\"]+" ./templates/content/wasi-cli/wasi-cli.csproj | 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
4348
- name: Test Template
4449
shell: bash
4550
run: |

0 commit comments

Comments
 (0)