Skip to content

Automated semantic versioning and cross-platform release artifacts on merge to main #33

Description

@DaraOladapo

Summary

On every merge to main, GitHub Actions should automatically bump the version using semantic versioning, create a GitHub Release, and publish release artifacts (NuGet package) built against Windows, Linux, and macOS.

Motivation

  • Eliminate manual version bumping in HttpClientServiceHelper.csproj
  • Ensure every merge to main produces a traceable, numbered release
  • Validate the package builds correctly on all three major OSes before publishing

Proposed Approach

Semantic Versioning Strategy

Use MinVer (or GitVersion) driven by git tags:

  • Tag format: v1.2.3
  • Version is inferred automatically from the latest tag + commit distance
  • No manual edits to <Version> in .csproj needed

Alternatively, use the Conventional Commits convention with a GHA bot (e.g. release-please) that:

  1. Parses commit messages (feat:, fix:, chore:, BREAKING CHANGE:)
  2. Opens a "Release PR" that bumps the version and updates a changelog
  3. On merge of the Release PR → tags the commit → triggers the publish workflow

Release Workflow (.github/workflows/release.yml)

Triggered on push to main:

matrix:
  os: [ubuntu-latest, windows-latest, macos-latest]

steps:
  1. Checkout
  2. Determine next semver (MinVer / release-please output)
  3. Restore & Build
  4. Test (with coverage)
  5. Pack NuGet (.nupkg) — one artifact per OS to confirm cross-platform build
  6. Upload artifacts to GitHub Release
  7. Push canonical .nupkg to NuGet Gallery (run once, not per-OS)

GitHub Release

  • Tag: v{major}.{minor}.{patch}
  • Release notes auto-generated from commit messages / changelog
  • Attached artifacts: .nupkg + .snupkg (symbols)

Acceptance Criteria

  • Merging to main triggers the release workflow with no manual steps
  • Version in the published NuGet package matches the git tag
  • Build matrix covers ubuntu-latest, windows-latest, macos-latest
  • A GitHub Release is created with attached .nupkg artifacts and auto-generated release notes
  • NuGet Gallery receives the new package version on every successful release

Notes

  • <GeneratePackageOnBuild>false</GeneratePackageOnBuild> is already set — pack step is explicit, which is correct
  • Current version is 1.0.12; first automated release should be 1.0.13 or 1.1.0 depending on chosen strategy
  • NuGet API key must be stored as a GitHub Actions secret: NUGET_API_KEY

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions