Skip to content

Fix release workflow to trigger on tag push and use tag as version#8

Merged
azurecoder merged 1 commit into
mainfrom
feature/dotprompt-sql-upgrade
Apr 6, 2026
Merged

Fix release workflow to trigger on tag push and use tag as version#8
azurecoder merged 1 commit into
mainfrom
feature/dotprompt-sql-upgrade

Conversation

@azurecoder
Copy link
Copy Markdown
Member

  • Trigger on 'v*' tag push instead of manual workflow_dispatch
  • Derive PackageVersion from the tag (strips leading 'v') using GITHUB_REF_NAME
  • Remove hardcoded 0.2.2 version

Usage: push a tag like 'v0.2.3' to trigger a NuGet release at that version.

- Trigger on 'v*' tag push instead of manual workflow_dispatch
- Derive PackageVersion from the tag (strips leading 'v') using GITHUB_REF_NAME
- Remove hardcoded 0.2.2 version

Usage: push a tag like 'v0.2.3' to trigger a NuGet release at that version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 6, 2026 21:58
@azurecoder azurecoder merged commit 81cca5b into main Apr 6, 2026
4 checks passed
@azurecoder azurecoder deleted the feature/dotprompt-sql-upgrade branch April 6, 2026 21:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GitHub Actions release workflow to publish NuGet packages automatically when a version tag is pushed, using the tag name as the package version.

Changes:

  • Switch release triggering from workflow_dispatch to push on tags matching v*.
  • Derive RELEASE_VERSION from GITHUB_REF_NAME (stripping the leading v).
  • Use the derived version for dotnet pack instead of a hardcoded version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 16 to +20
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Get latest tag version
- name: Get version from tag
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The steps: list items appear to be indented at the same level as the steps: key (instead of being nested under it). GitHub Actions requires sequence items under steps: to be indented deeper (e.g., steps: then - uses:). As written, this workflow is likely invalid YAML and may not run.

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
push:
tags:
- 'v*'
Copy link

Copilot AI Apr 6, 2026

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 exactly v, which would make RELEASE_VERSION empty after ${GITHUB_REF_NAME#v} and cause dotnet pack to run with an empty PackageVersion. Consider tightening the tag glob (e.g., require at least one character after v) and/or adding a guard that fails the job when RELEASE_VERSION is empty/invalid.

Copilot uses AI. Check for mistakes.
dotnet-version: 9.0.x
- name: Get latest tag version
- name: Get version from tag
id: vars
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step Get version from tag sets id: vars but no step outputs are defined/consumed. Either remove the unused id or switch to step outputs (via $GITHUB_OUTPUT) if you intended to reference the version as steps.vars.outputs....

Suggested change
id: vars

Copilot uses AI. Check for mistakes.
run: |
echo "Release version: $RELEASE_VERSION"
dotnet pack -p:PackageVersion=0.2.2
dotnet pack -p:PackageVersion=$RELEASE_VERSION
Copy link

Copilot AI Apr 6, 2026

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.

Suggested change
dotnet pack -p:PackageVersion=$RELEASE_VERSION
dotnet pack -p:Version=$RELEASE_VERSION -p:PackageVersion=$RELEASE_VERSION

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants