Skip to content

Commit 5086c80

Browse files
Document push-driven stable releases
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 087bf89 commit 5086c80

5 files changed

Lines changed: 43 additions & 19 deletions

File tree

docs/content/get-started/repository-setup.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ on:
3838
workflow_dispatch:
3939
schedule:
4040
- cron: '0 0 * * *'
41+
push:
42+
branches:
43+
- main
4144
pull_request:
4245
branches:
4346
- main
@@ -47,10 +50,11 @@ on:
4750
- reopened
4851
- synchronize
4952
- labeled
53+
- unlabeled
5054

5155
concurrency:
5256
group: ${{ github.workflow }}-${{ github.ref }}
53-
cancel-in-progress: true
57+
cancel-in-progress: false
5458

5559
permissions:
5660
contents: write
@@ -68,8 +72,10 @@ jobs:
6872
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
6973
```
7074
71-
Every permission in that block is required. See [Workflow inputs](../reference/workflow-inputs.md) for what each one is
72-
used for, and [Calling the workflow](../guides/calling-the-workflow.md) for passing test secrets and variables.
75+
Every permission in that block is required. A push to `main` publishes a stable release after the full pipeline passes;
76+
the pull-request trigger handles CI, prereleases, and prerelease cleanup. See
77+
[Workflow inputs](../reference/workflow-inputs.md) for what each permission is used for, and
78+
[Calling the workflow](../guides/calling-the-workflow.md) for passing test secrets and variables.
7379

7480
## 4. Add the settings file
7581

docs/content/guides/calling-the-workflow.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
workflow_dispatch:
2222
schedule:
2323
- cron: '0 0 * * *'
24+
push:
25+
branches:
26+
- main
2427
pull_request:
2528
branches:
2629
- main
@@ -30,10 +33,11 @@ on:
3033
- reopened
3134
- synchronize
3235
- labeled
36+
- unlabeled
3337

3438
concurrency:
3539
group: ${{ github.workflow }}-${{ github.ref }}
36-
cancel-in-progress: true
40+
cancel-in-progress: false
3741

3842
permissions:
3943
contents: write
@@ -53,6 +57,10 @@ jobs:
5357
5458
</details>
5559
60+
Stable releases are evaluated from a push to the default branch. A merged pull request supplies its version label and
61+
release notes; a direct default-branch push or a manual dispatch uses the default `Patch` bump and commit-based notes.
62+
Keep the `pull_request` trigger for CI, prereleases, and prerelease cleanup.
63+
5664
## Passing test data
5765

5866
The reusable workflow at `.github/workflows/workflow.yml` declares four workflow-call secrets,
@@ -175,9 +183,9 @@ Notes:
175183

176184
## Important file change detection
177185

178-
The workflow automatically detects whether a pull request contains changes to "important" files that should enter the
179-
build, test, and publish path. This prevents unnecessary work and releases when only files outside the configured
180-
patterns are modified.
186+
The workflow automatically detects whether a pull request or default-branch push contains changes to "important" files
187+
that should enter the build, test, and publish path. This prevents unnecessary work and releases when only files outside
188+
the configured patterns are modified.
181189

182190
### Files that trigger the important-change path
183191

docs/content/guides/versioning-and-releases.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
title: Versioning and releases
3-
description: How Process-PSModule resolves a version from pull-request labels, what a release produces, and how prereleases are published and cleaned up.
3+
description: How Process-PSModule resolves a version from pull-request labels, publishes stable releases from default-branch pushes, and cleans up prereleases.
44
---
55

66
# Versioning and releases
77

88
Process-PSModule orchestrates the module lifecycle through GitHub Actions. Version progression is label-driven in pull
9-
requests and resolved once, in the Plan stage, before anything is built.
9+
requests and resolved once, in the Plan stage, before anything is built. Stable publication occurs only from a push to
10+
the configured default branch.
1011

1112
## Flow
1213

@@ -18,6 +19,10 @@ requests and resolved once, in the Plan stage, before anything is built.
1819

1920
Test and lint stages run before the publish gates, and publish is blocked when required checks fail.
2021

22+
An open labelled pull request can publish a prerelease. A closed pull request only cleans up its prereleases. When a
23+
pull request merges, the resulting push to the default branch resolves that pull request's labels and creates the
24+
stable release from the exact pushed commit.
25+
2126
## Version labels
2227

2328
The bump comes from the pull-request label; the next version is computed as `current version + bump`.
@@ -26,18 +31,20 @@ The bump comes from the pull-request label; the next version is computed as `cur
2631
| --- | --- |
2732
| `major` / `breaking` | Breaking change; bump `MAJOR`. |
2833
| `minor` / `feature` | New feature; bump `MINOR`. |
29-
| `patch` / `fix` | Bugfix; bump `PATCH`. Applied by default when no label is present. |
34+
| `patch` / `fix` | Bugfix; bump `PATCH`. |
3035
| `Prerelease` | Publish as a prerelease; not promoted to latest. |
3136
| `NoRelease` | Run the pipeline, skip publication. |
3237

3338
Multiple or conflicting version labels (for example `major` together with `NoRelease`) are rejected and block the merge.
39+
With `AutoPatching: true`, an unlabeled pull request defaults to `Patch`; otherwise it needs an explicit version label.
40+
Direct pushes and manual dispatches on the default branch always use `Patch`, regardless of `AutoPatching`.
3441

3542
The label names are configurable through `Publish.Module.MajorLabels`, `MinorLabels`, `PatchLabels`, and
3643
`IgnoreLabels` — see [Settings](../reference/settings.md).
3744

3845
## Branch types
3946

40-
- **Main (stable)**publishes stable releases. A prerelease label publishes a prerelease from `main`.
47+
- **Main (stable)**pushes publish stable releases. A prerelease label on an open pull request publishes a prerelease.
4148
- **Development** — optional prerelease branch (for example `dev`). Each push publishes a prerelease.
4249
- **Feature branch** — optional feature branch. A prerelease label publishes a prerelease for testing.
4350

@@ -49,8 +56,8 @@ A pull request labelled `Prerelease` publishes a prerelease version (for example
4956
but not promoted as latest. When that pull request is merged with a version label, the stable version is computed from
5057
the label and the current version on the release branch.
5158

52-
When a pull request is closed without merging, the prerelease versions and tags created for it are removed, so
53-
abandoned work leaves no orphaned prereleases. This is controlled by `Publish.Module.AutoCleanup`.
59+
When a pull request closes, the prerelease versions and tags created for it are removed, so abandoned or promoted work
60+
leaves no orphaned prereleases. This is controlled by `Publish.Module.AutoCleanup`.
5461

5562
## What a release produces
5663

docs/content/specification/design.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ The behaviour in the [spec](spec.md) is delivered by a **single reusable GitHub
1111

1212
### Single entry point
1313

14-
The reusable workflow accepts a caller workflow and minimal caller configuration: a `pull_request`-triggered job that
15-
calls `workflow.yml` and passes the `PSGALLERY_API_KEY` secret. The full caller template is in
14+
The reusable workflow accepts a caller workflow and minimal caller configuration: a `pull_request`-triggered job for
15+
CI and prereleases plus a default-branch `push` trigger for stable publication. The caller calls `workflow.yml` and
16+
passes the required secrets. The full caller template is in
1617
[Repository setup](../get-started/repository-setup.md#3-add-the-caller-workflow), and the interface it targets is
1718
documented in [Workflow inputs](../reference/workflow-inputs.md).
1819

@@ -46,8 +47,10 @@ That enriched object is an internal inter-workflow contract, not an authoring fo
4647

4748
## Scenario matrix
4849

49-
Release intent comes from pull-request labels and is resolved once, in the Plan job. The label-to-bump mapping, the
50-
handling of conflicting labels, and the branch types that may publish are documented in
50+
Release intent comes from pull-request labels and is resolved once, in the Plan job. A default-branch push resolves the
51+
merged pull request for its labels, while a direct push or manual dispatch defaults to `Patch` regardless of
52+
`AutoPatching`. The label-to-bump
53+
mapping, handling of conflicting labels, and branch types that may publish are documented in
5154
[Versioning and releases](../guides/versioning-and-releases.md).
5255

5356
Tests run on **Windows** (latest), **Linux** (Ubuntu latest), and **macOS** (latest). Failures on any platform block

docs/content/specification/spec.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Requirements for Process-PSModule — an end-to-end PowerShell modu
77

88
## Premise
99

10-
A PowerShell module's lifecycle — from source code to versioned, published artifact — MUST be reliable, repeatable, and as automated as possible. Contributors focus on code and tests; the pipeline focuses on build, test, quality, documentation, and release. The pipeline MUST be driven entirely by pull-request labels and merge events, never by manual intervention or external tooling. The result is a versioned, immutable artifact — a module package in the PowerShell Gallery and its documentation site — paired with a GitHub Release and a git tag.
10+
A PowerShell module's lifecycle — from source code to versioned, published artifact — MUST be reliable, repeatable, and as automated as possible. Contributors focus on code and tests; the pipeline focuses on build, test, quality, documentation, and release. The pipeline MUST use GitHub pull-request labels and default-branch pushes for release decisions, with direct pushes and workflow dispatch as supported GitHub-native release paths. The result is a versioned, immutable artifact — a module package in the PowerShell Gallery and its documentation site — paired with a GitHub Release and a git tag.
1111

1212
### Principles
1313

@@ -43,7 +43,7 @@ The pipeline MUST generate module documentation from the source (cmdlet help, RE
4343

4444
### FR5 — Support label-driven versioning and publication { #fr5 }
4545

46-
The pipeline MUST read pull-request labels (`Major`, `Minor`, `Patch`, `Prerelease`, `NoRelease`) to decide the semantic-version bump. It MUST compute the next version automatically, never reading or writing a hand-edited version file. A merge to the release branch MUST trigger publication to the PowerShell Gallery and documentation site; a prerelease label MUST result in a prerelease version available for testing before stable release.
46+
The pipeline MUST read pull-request labels (`Major`, `Minor`, `Patch`, `Prerelease`, `NoRelease`) to decide the semantic-version bump. It MUST compute the next version automatically, never reading or writing a hand-edited version file. A push to the release branch MUST trigger publication to the PowerShell Gallery and documentation site; a prerelease label MUST result in a prerelease version available for testing before stable release.
4747

4848
### FR6 — Produce immutable, linkable releases { #fr6 }
4949

0 commit comments

Comments
 (0)