A PowerShell-native semantic release toolkit for automated versioning and release workflows based on Git history and Conventional Commits.
The initial module surface provides the reusable semantic-release core for Git-based PowerShell workflows:
Get-SemanticReleaseCommitRangedetects the last version tag and returns the commit-range basis.Get-SemanticReleaseCommitMessagecollects commit messages since the last tag, or from the full history when no tag exists.Get-SemanticReleaseLabelinfers the semantic-release label (Major,Minor, orPatch) from commit messages.Get-SemanticReleaseNextVersioncalculates the next semantic version, including preview and stable-release transitions.Set-SemanticReleaseJsonVersionupdates a top-level JSON version key withShouldProcesssupport.Set-SemanticReleasePropertiesVersionupdates a version property in Java-style.propertiesfiles such asgradle.properties.Update-SemanticReleaseVersioninfers the next stable or preview version from Git commit history and updates a JSON or.propertiesversion file in one step.
Example workflow:
$messages = Get-SemanticReleaseCommitMessage
$label = Get-SemanticReleaseLabel -Message $messages
$plan = Get-SemanticReleaseNextVersion -CurrentVersion ([semver]'0.1.0-preview') -Label $label -StableRelease
$result = Set-SemanticReleaseJsonVersion -Path ./project.json -Label $label -Confirm:$false
$gradle = Set-SemanticReleasePropertiesVersion -Path ./gradle.properties -Key version -Label $label -Confirm:$false
$auto = Update-SemanticReleaseVersion -Path ./gradle.properties -ProjectRoot . -Preview -Confirm:$falsemainis the stable release branch. Pushing a merged release change tomainruns.github/workflows/Publish.yml, publishes the stable module, creates the verifiedchore(release): <version>commit, creates the annotated version tag, and prepares the next prerelease version ondevelop.developis the prerelease branch. Run the same workflow withworkflow_dispatchfromdevelopwhen you want to publish the current prerelease and bumpdevelopto the next preview version.- The workflow expects the repository secret
PSGALLERY_APIso GitHub Actions can publish to PSGallery.
.github/workflows/Tests.ymlmirrors the NovaModuleTools CI flow for build, unit tests, integration tests, artifacts, and optional CodeScene upload when the required GitHub variables and secrets are configured..github/workflows/powershell.ymluploads SARIF results fromPSScriptAnalyzer..github/workflows/dependency-review.ymlruns GitHub dependency review on pull requests todevelop.
Follow this workflow when working with Copilot in this repository.
- Design
- Start with
/agent architect,.github/agents/architect.agent.md, and.github/prompts/design-change.prompt.mdto scope the change before implementation.
- Start with
- Implement
- Use
/agent powershell-developer,.github/agents/powershell-developer.agent.md, and.github/prompts/implement-issue.prompt.mdwhen the change is already scoped. - If the work is mainly about tests or coverage, use
/agent test-engineer,.github/agents/test-engineer.agent.md, and.github/prompts/improve-test-coverage.prompt.md.
- Use
- Review
- Use
/agent reviewer,.github/agents/reviewer.agent.md, and.github/prompts/review-change.prompt.mdbefore handoff or pull request review.
- Use
- Prepare release
- Use
/agent release-manager,.github/agents/release-manager.agent.md, and.github/prompts/prepare-release.prompt.mdwhen preparing the pull request summary and release-facing follow-up.
- Use
- Use Nova commands and
project.jsonfor build, test, package, and release behavior. - Treat
project.jsonManifest.PowerShellHostVersionas the compatibility target for PowerShell code, tests, and examples. If it is5.1, do not introduce PowerShell 7.x-only features. - Keep local quality checks ordered as ScriptAnalyzer first, then
Invoke-NovaBuild, thenInvoke-NovaTest, thenTest-NovaBuildwhen your project defines both test flows. - Use
Invoke-NovaTestfor unit validation andTest-NovaBuildfor build-validation integration runs. Do not validate with directInvoke-Pester, because it can bypass Nova's build/import/StrictMode flow and disagree with later user-visible test runs. - Keep public command unit coverage in
tests/public/<Command>.Tests.ps1and keep per-command integration ownership intests/public/<Command>.Integration.Tests.ps1when built-module behavior itself needs validation. - For destructive or environment-coupled public commands, prefer safe
-WhatIfintegration coverage when that still provesShouldProcesswiring and command behavior. - If the repository quality loop or
Invoke-ScriptAnalyzerCI.ps1reports ScriptAnalyzer findings, fix them before review or handoff. - Follow
.github/instructions/psscriptanalyzer.instructions.mdas the ScriptAnalyzer workflow source of truth. Prefer./scripts/build/Invoke-ScriptAnalyzerCI.ps1and the repository quality loop, when present, and use directInvoke-ScriptAnalyzeronly for focused local checks that reuse the repo-approved settings. - Keep one externally called function per file and match the file name to that function. Public files own one command each; private files may keep extra related functions only as same-file top-level support helpers, and PowerShell functions must not declare nested functions inside their bodies.
- Follow
.github/instructions/code-quality-matrix.instructions.mdas the best-effort maintainability guidance for source/helper scripts, and.github/instructions/testing-policy.instructions.mdfor test design. These guide agents and reviewers in this generated project. - Generate valid PlatyPS help under
docs/SemanticRelease/en-US/whenever command help changes. UseNew-MarkdownCommandHelp,Update-MarkdownCommandHelp, andTest-MarkdownCommandHelpinstead of hand-writing the help structure. - Every new public entry point must add its matching help file in the same change.
- Make every changed or generated text file end immediately after exactly one newline terminator; do not leave a blank spacer line at the bottom. Use
pwsh -NoLogo -NoProfile -File ./scripts/build/Test-TextFileFormatting.ps1for a focused check, and keeptests/TextFileFormatting.Tests.ps1passing when the project uses Pester. - Do not exclude or suppress PSScriptAnalyzer rules; fix analyzer findings in the code.
- Do not hand-create module
.psm1or module.psd1files in source; Nova generates them underdist/SemanticRelease/. - Add PlatyPS-compatible help under
docs/SemanticRelease/en-US/when public commands or public classes change. - Keep tests mirrored to source files: every new or changed
src/**/*.ps1file should have one focused.Tests.ps1file, for examplesrc/private/foo/Get-Thing.ps1->tests/private/foo/Get-Thing.Tests.ps1. - For public commands, the mirrored unit-test owner is
tests/public/<Command>.Tests.ps1; addtests/public/<Command>.Integration.Tests.ps1when the built public command behavior itself needs integration coverage. - Put shared test setup in
tests/TestHelpers/or a test-support file instead of grouping unrelated source coverage into broad catch-all tests.
Use this repository as the starting point for your module.
- Review
README.md,CONTRIBUTING.md, and.github/copilot-instructions.md. - Use
Invoke-NovaBuild/% nova buildto produce the first local build. - Use
Invoke-NovaTest/% nova testfor unit tests andTest-NovaBuild/% nova test --buildfor build-validation integration tests before opening a pull request.