Advanced Compiler-Compiler Platform
This document describes how to validate the NuGet release workflow for the Minotaur project.
The CI/CD workflow (ci-cd-enhanced.yml) implements the following release strategy:
Fixed the semantic versioning calculation for main branch releases by updating GitVersion.yml:
Problem: When PRs were merged to main, GitVersion in ContinuousDeployment mode generated prerelease versions (e.g., 1.0.0-ci.1), preventing the stable release job from triggering (which requires prerelease == '').
Solution: Changed the main branch configuration in GitVersion.yml:
main:
regex: ^master$|^main$
mode: ContinuousDelivery # Changed from ContinuousDeployment
tag: '' # Added to prevent prerelease tags
increment: Patch
source-branches: ['develop', 'feature', 'support', 'hotfix']
This ensures that merges to main generate clean version numbers (e.g., 1.0.0) without prerelease metadata, allowing the stable release workflow to execute properly.
Removed the if: github.event_name != 'pull_request' condition from the package job in .github/workflows/ci-cd-enhanced.yml.
Before:
package:
runs-on: ubuntu-latest
needs: [calculate-version, build-and-test, code-quality, lint-and-format]
if: github.event_name != 'pull_request' # <-- This blocked PR packaging
outputs:
package-path: ${{ steps.package.outputs.package-path }}
After:
package:
runs-on: ubuntu-latest
needs: [calculate-version, build-and-test, code-quality, lint-and-format]
# Condition removed - now packages are created for all events
outputs:
package-path: ${{ steps.package.outputs.package-path }}
Expected Behavior:
X.Y.Z-beta.PR# (e.g., 1.0.0-beta.PR123)publish-pr-package job publishes to GitHub Packages onlyValidation Steps:
main branchPreReleaseTag: beta, FullSemVer: X.Y.Z-beta.PR#https://github.com/DevelApp-ai/Minotaur/packagesExpected Behavior:
X.Y.Z-alpha.PR# (e.g., 1.0.0-alpha.PR456)publish-pr-package job publishes to GitHub Packages onlyValidation Steps:
develop branch (or any other branch)PreReleaseTag: alpha, FullSemVer: X.Y.Z-alpha.PR#Expected Behavior:
X.Y.Z (e.g., 1.0.0 or 1.0.1 - stable release, no prerelease tag)release job runs and:
vX.Y.Zpublish-pr-package job does NOT run (event is push, not PR)prerelease job does NOT run (ref is main, not develop/copilot/feature)Validation Steps:
main branchPreReleaseTag: (empty), version: X.Y.Zhttps://github.com/DevelApp-ai/Minotaur/releases
vX.Y.Z.nupkg fileshttps://www.nuget.org/packages/DevelApp.Minotaur/
The workflow uses GitVersion for version calculation:
# For pull requests to main
PRERELEASE="beta"
FULL_VERSION="${VERSION}-beta.PR${PR_NUMBER}"
# For pull requests to other branches
PRERELEASE="alpha"
FULL_VERSION="${VERSION}-alpha.PR${PR_NUMBER}"
# For pushes to main (after PR merge)
PRERELEASE="" # Empty for stable releases
VERSION="${VERSION}" # e.g., "1.0.1"
calculate-version → build-and-test → code-quality/lint-and-format → package → publish-pr-package
(GitHub Packages only)
calculate-version → build-and-test → code-quality/lint-and-format → package → release
├─ Create GitHub Release
├─ Publish to GitHub Packages
└─ Publish to NuGet.org
Ensure the following secrets are configured in GitHub repository settings:
GITHUB_TOKEN: Automatically provided by GitHub Actions (for GitHub Packages)NUGET_API_KEY: NuGet.org API key (for NuGet.org publishing)# List packages for organization repositories
gh api /orgs/DevelApp-ai/packages?package_type=nuget
# List packages for user repositories
# Replace USERNAME with the actual GitHub username
gh api /users/USERNAME/packages?package_type=nuget
# Or visit in browser:
# https://github.com/orgs/DevelApp-ai/packages?repo_name=Minotaur
# Search for package using NuGet CLI
nuget search DevelApp.Minotaur
# Or visit in browser:
# https://www.nuget.org/packages/DevelApp.Minotaur/
# Install from NuGet.org (full releases only)
dotnet add package DevelApp.Minotaur --version X.Y.Z
# Install from GitHub Packages (all releases)
dotnet add package DevelApp.Minotaur --version X.Y.Z-beta.PR123 \
--source https://nuget.pkg.github.com/DevelApp-ai/index.json
if: github.event_name != 'pull_request' condition was preventing execution1.0.0-ci.1) instead of stable versionContinuousDeployment mode which adds prerelease metadataContinuousDelivery mode with tag: ''.nupkg file from the GitHub Release artifacts (e.g., DevelApp.Minotaur.1.0.0.nupkg).nupkg fileNote: The .nupkg file can also be found in the GitHub Actions workflow artifacts under “nuget-packages”
✅ Pull requests to main create beta packages published to GitHub Packages only ✅ Pull requests to other branches create alpha packages published to GitHub Packages only ✅ Merges to main create stable releases with tags published to both GitHub Packages and NuGet.org ✅ All tests pass before packaging and publishing ✅ Code quality and linting checks pass before packaging
Local verification that the solution builds and tests correctly:
# Restore dependencies
dotnet restore src/Minotaur.sln
# Build
dotnet build src/Minotaur.sln --configuration Release --no-restore
# Run tests
dotnet test src/Minotaur.sln --configuration Release --no-build
# Create package (test)
dotnet pack src/Minotaur/Minotaur.csproj --configuration Release --no-build \
--output ./packages -p:PackageVersion=1.0.0-test.1
All commands should complete successfully with no errors.