-
Notifications
You must be signed in to change notification settings - Fork 1
Fix release workflow to trigger on tag push and use tag as version #8
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,9 @@ | ||||||
| name: release | ||||||
|
|
||||||
| on: | ||||||
| workflow_dispatch: | ||||||
| push: | ||||||
| tags: | ||||||
| - 'v*' | ||||||
|
|
||||||
| jobs: | ||||||
| build: | ||||||
|
|
@@ -15,14 +17,12 @@ jobs: | |||||
| uses: actions/setup-dotnet@v4 | ||||||
| with: | ||||||
| dotnet-version: 9.0.x | ||||||
| - name: Get latest tag version | ||||||
| - name: Get version from tag | ||||||
| id: vars | ||||||
|
||||||
| id: vars |
Copilot
AI
Apr 6, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow only overrides PackageVersion. The project file currently hardcodes both <Version> and <PackageVersion> (e.g., 0.2.2), so the assembly/package metadata can become inconsistent across releases. Consider also passing -p:Version=$RELEASE_VERSION (or removing the hardcoded values from the project) so all version metadata comes from the tag.
| dotnet pack -p:PackageVersion=$RELEASE_VERSION | |
| dotnet pack -p:Version=$RELEASE_VERSION -p:PackageVersion=$RELEASE_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag filter
v*also matches a tag named exactlyv, which would makeRELEASE_VERSIONempty after${GITHUB_REF_NAME#v}and causedotnet packto run with an emptyPackageVersion. Consider tightening the tag glob (e.g., require at least one character afterv) and/or adding a guard that fails the job whenRELEASE_VERSIONis empty/invalid.