Skip to content

Switch NuGet publish workflow to tag-driven releases with 4-part versioning#7

Merged
maikebing merged 3 commits intomasterfrom
copilot/update-github-action-for-tags
Mar 17, 2026
Merged

Switch NuGet publish workflow to tag-driven releases with 4-part versioning#7
maikebing merged 3 commits intomasterfrom
copilot/update-github-action-for-tags

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

This updates the release pipeline to publish from version tags instead of release events. Tags like v9.3.0.4 now drive package version generation, package builds, GitHub Release publication, GitHub Packages publication, and NuGet.org publication in one flow.

  • Tag-driven release entrypoint

    • Replace release.published trigger with push.tags: v*
    • Keep workflow_dispatch for manual runs, but align its version input with the same tag-based format
  • Version normalization

    • Add a dedicated prepare job to derive the package version from the tag/input
    • Strip the v prefix for dotnet pack
    • Enforce the repository’s 4-part version format: v9.3.0.4 / 9.3.0.4
  • Packaging flow

    • Reuse the normalized version across all package builds:
      • LVGLSharp.Native
      • LVGLSharp.Interop
      • LVGLSharp.Core
      • LVGLSharp.Runtime.Windows
      • LVGLSharp.Runtime.Linux
      • LVGLSharp.Forms
    • Preserve the existing native artifact + local NuGet source flow
  • Release publishing

    • On tag builds, publish .nupkg artifacts to:
      • GitHub Release
      • GitHub Packages
      • NuGet.org
    • Handle reruns safely by uploading to an existing GitHub Release when present, or creating it when missing
  • Workflow hardening

    • Add explicit minimal permissions for the new prepare job
    • Improve release lookup failure reporting for non-404 GitHub API responses
on:
  push:
    tags:
      - "v*"

# v9.3.0.4 -> 9.3.0.4
VERSION="${RAW_VERSION#v}"

dotnet pack ... -p:Version=${{ needs.prepare.outputs.package_version }}

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 17, 2026 11:32
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Co-authored-by: maikebing <3445167+maikebing@users.noreply.github.com>
Copilot AI changed the title [WIP] Update GitHub Action to handle tag deployments Switch NuGet publish workflow to tag-driven releases with 4-part versioning Mar 17, 2026
Copilot AI requested a review from maikebing March 17, 2026 11:38
@maikebing maikebing marked this pull request as ready for review March 17, 2026 12:27
Copilot AI review requested due to automatic review settings March 17, 2026 12:27
@maikebing maikebing merged commit a1c9795 into master Mar 17, 2026
Copy link
Copy Markdown

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 NuGet publishing workflow to run from version tags (e.g., v9.3.0.4) instead of release.published, and introduces a dedicated version normalization/validation step to enforce 4-part versions across all packaged projects.

Changes:

  • Switch workflow trigger from release.published to push.tags: v* (while keeping workflow_dispatch).
  • Add a prepare job to normalize and validate the version (strip leading v, enforce x.y.z.w) and expose it via job outputs.
  • Use the normalized version output for all dotnet pack steps, and add GitHub Release upload/create behavior on tag builds.

Comment on lines +56 to +62
if [[ "${GITHUB_REF}" =~ ^refs/tags/ ]]; then
RAW_TAG="${GITHUB_REF_NAME}"
fi

if [ -z "$RAW_TAG" ]; then
RAW_TAG="v$VERSION"
fi
@maikebing maikebing deleted the copilot/update-github-action-for-tags branch March 17, 2026 12:59
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.

3 participants