Repository navigation
Add a tag-driven release workflow with a dry-run mode - #33
Merged
Merged
Conversation
release.yml checks the tag against the manifest and CHANGELOG, builds, runs every test stage, checks the package installs on both editions, publishes to the PowerShell Gallery from the psgallery environment and creates the GitHub Release. A manual run publishes nothing. Co-Authored-By: Claude <noreply@anthropic.com>
- Publish the .nupkg the package check tested, after comparing its hash - Gallery check fails when the Gallery cannot be reached; a dry run only warns when the version is already published - Separate concurrency groups so a dry run cannot cancel a queued release - Wrap lines over 120 characters Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a release workflow so a version is published by pushing a tag, with the owner approving the publish step.
Merging this publishes nothing. The workflow only runs on a
v*tag or a manual run, and a manual run is always a dry run.What a release does
Push a tag
v<ModuleVersion>on a commit that is onmaster:Build/Get-ReleaseInfo.ps1): fails before building unless the tag equalsModuleVersionin the manifest,CHANGELOG.mdhas a dated section for the version, the version is not on the Gallery yet, and the commit is onmaster. If the Gallery cannot be reached, the check fails../Tests/test-local.ps1, every stage, the same checks as CI on PowerShell 7 and Windows PowerShell 5.1.Build/Test-ReleasePackage.ps1): packs the build into a.nupkg, pushes it to a temporary folder repository withPublish-PSResource -NupkgPath, saves the package and imports it on both editions (version, function count, no import warnings).Publish-PSResource -NupkgPathof that exact.nupkg, after comparing its SHA256 with the one the build job recorded. Runs in thepsgalleryenvironment, which holdsPSGALLERY_API_KEY. This job does not check out the repository.contents: write.Run workflow (manual) does steps 1 to 3 and stops. In a dry run the notes may come from
[Unreleased], and a version that is already on the Gallery is a warning, not a failure. Dry runs and tag runs use separate concurrency groups, so a dry run cannot cancel a waiting release.Setup (done)
psgallery: the owner is the required reviewer and deployments are limited to tags matchingv*.PSGALLERY_API_KEY: a Gallery key scoped toConnectWiseControlAPI, "Push new package versions" only.Files
.github/workflows/release.yml: the workflow. Actions are pinned to the same commits asci.yml.Build/Get-ReleaseInfo.ps1,Build/Test-ReleasePackage.ps1: the checks, runnable locally.Tests/Release.Tests.ps1: 21 tests for the release check (tag and version mismatch, missing or undated CHANGELOG section, dry-run fallback, Gallery answers).AGENTS.md: new "Releasing" section replaces the manualPublish-Moduleinstructions.CHANGELOG.mdand a comment inci.ymlupdated.Review
A code review (rule compliance, docs accuracy, bug scan, security and logic) found no bugs and no security problems. Its five smaller findings are fixed in the second commit:
.nupkgTesting
./Tests/test-local.ps1: all stages pass; 477 tests pass on both editions (25 live tests skip without a server)../Build/Get-ReleaseInfo.ps1 -AllowUnreleasedpasses against the real Gallery (0.5.0 is not published); with-Tag v0.5.0it fails as intended, because the CHANGELOG has no[0.5.0]section yet../Build/Test-ReleasePackage.ps1passes locally: 0.5.0, 32 functions, no aliases or warnings on both editions.master. The dry run is the first step after this merges.🤖 Generated with Claude Code