You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-45Lines changed: 12 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,6 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
45
45
-[Workflow overview](#workflow-overview)
46
46
-[Plan](#plan)
47
47
-[Lint-Repository](#lint-repository)
48
-
-[Plan job](#plan-job)
49
48
-[Build module](#build-module)
50
49
-[Test source code](#test-source-code)
51
50
-[Lint source code](#lint-source-code)
@@ -113,65 +112,33 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
113
112
The Plan job is the single decision point of the workflow. It runs two steps in sequence:
114
113
115
114
1.**Get-PSModuleSettings** — loads the settings file (`.github/PSModule.yml`) and emits a fully resolved `Settings` JSON object that every downstream job consumes.
116
-
2.**Resolve-PSModuleVersion** — calculates the next module version from the resolved settings and the labels on the current pull request. Emits `ModuleVersion`, `ModulePrerelease`, `ModuleFullVersion`, `ReleaseType`, and `CreateRelease` as job outputs.
115
+
2.**Resolve-PSModuleVersion** — calculates the next module version from the resolved settings and the labels on the current pull request.
117
116
118
-
The resolved version is passed into `Build-Module` so the manifest is stamped with the final version **before** the test stages run. The same artifact is then published unchanged by `Publish-Module`, which also uploads the zipped module as a GitHub Release asset. The bytes that are tested are the bytes that ship to the PowerShell Gallery and to GitHub Releases.
117
+
After both steps complete, the resolved version is merged into `Settings` under a `Module` key:
119
118
120
-
#### How version resolution works
121
-
122
-
The [Resolve-PSModuleVersion](https://github.com/PSModule/Resolve-PSModuleVersion) step reads configuration from `Settings.Publish.Module`:
123
-
124
-
| Key | Description |
119
+
|`Settings.Module` field | Description |
125
120
| --- | ----------- |
126
-
|`ReleaseType`|`Release`, `Prerelease`, or `None`. |
127
-
|`AutoPatching`| When `true`, a patch bump is applied even without a label. |
128
-
|`IncrementalPrerelease`| When `true`, an incrementing counter is appended to prerelease tags. |
129
-
|`DatePrereleaseFormat`| Optional .NET DateTime format string for date-based prerelease suffixes. |
130
-
|`VersionPrefix`| Tag prefix (typically `v`). |
131
-
|`MajorLabels`, `MinorLabels`, `PatchLabels`| Comma-separated PR labels that trigger the corresponding bump. |
132
-
|`IgnoreLabels`| Comma-separated PR labels that suppress version creation. |
133
-
134
-
Resolution algorithm:
135
-
136
-
1. Loads the `pull_request` event payload and collects PR labels.
137
-
2. Validates `ReleaseType`; applies `IgnoreLabels` override (suppresses release if matched).
138
-
3. Picks the bump type: `MajorLabels` > `MinorLabels` > (`PatchLabels` or `AutoPatching`).
139
-
4. Reads the latest version from GitHub Releases (`gh release list`) and the PowerShell Gallery (`Find-PSResource`),
140
-
takes the higher of the two as the baseline.
141
-
5. Bumps the baseline (major, minor, or patch).
142
-
6. For prereleases, appends the sanitized branch name, optionally a `DatePrereleaseFormat` timestamp, and an
143
-
incremental counter calculated from existing prereleases on the same baseline + branch.
144
-
7. Emits outputs:
145
-
146
-
| Output | Description |
147
-
| --- | --- |
148
121
|`Version`|`Major.Minor.Patch` portion (for example `1.4.0`). |
149
122
|`Prerelease`| Prerelease tag, empty when not a prerelease. |
150
123
|`FullVersion`| Full string including prefix and prerelease (for example `v1.4.0-mybranch001`). |
151
-
|`ReleaseType`|`Release`, `Prerelease`, or `None` when no bump label is found. |
152
-
|`CreateRelease`|`true` when a release or prerelease should be created. |
124
+
|`ReleaseType`|`Release`, `Prerelease`, or `None`. |
125
+
|`CreateRelease`|`true` when a release or prerelease will be created. |
153
126
154
-
When `ReleaseType` is `None`, when an `IgnoreLabels` label is present, or when no version bump label is found
155
-
(and `AutoPatching` is disabled), `CreateRelease` is `false` and the version outputs are empty strings.
127
+
All downstream jobs receive this single enriched `Settings` object — there are no separate version outputs.
128
+
The version decided here is the version that ships. `Build-Module` stamps it into the manifest before any test runs,
129
+
and `Publish-Module` publishes the artifact unchanged.
- Reads the settings file `.github/PSModule.yml` in the module repository to configure the workflow.
166
-
- Gathers context for the process from GitHub and the repo files, configuring what tests to run, if and what kind of release to create, and whether
167
-
to setup testing infrastructure and what operating systems to run the tests on.
168
-
- Calculates the next module version from PR labels and existing releases, then publishes it as job outputs so Build-Module can stamp the manifest before the artifact is tested.
169
-
170
135
### Build module
171
136
172
137
[workflow](./.github/workflows/Build-Module.yml)
173
138
139
+
- Receives the resolved version from `Settings.Module` and stamps it into the module manifest before the artifact is uploaded.
174
140
- Compiles the module source code into a PowerShell module.
141
+
- Produces the artifact that flows unchanged through test and publish stages.
175
142
176
143
### Test source code
177
144
@@ -367,8 +334,8 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
- Publishes the artifact to the PowerShell Gallery exactly as built — no version mutation.
338
+
- Creates a GitHub Release using the version already stamped in the manifest.
372
339
- Attaches the built module as a `.zip` asset on the GitHub Release so consumers can download the exact bytes that were tested and pushed to the PowerShell Gallery.
373
340
-**Abandoned PR cleanup**: When a PR is closed without merging (abandoned), the workflow automatically cleans up any
374
341
prerelease versions and tags that were created for that PR. This ensures that abandoned work doesn't leave orphaned
0 commit comments