Skip to content

Commit 4072d6e

Browse files
Document the Plan job and the release-asset upload guarantee
1 parent 9461604 commit 4072d6e

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

README.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
4343
- [How to get started](#how-to-get-started)
4444
- [How it works](#how-it-works)
4545
- [Workflow overview](#workflow-overview)
46-
- [Get-Settings](#get-settings)
46+
- [Plan](#plan)
4747
- [Lint-Repository](#lint-repository)
48-
- [Get settings](#get-settings-1)
48+
- [Plan job](#plan-job)
4949
- [Build module](#build-module)
5050
- [Test source code](#test-source-code)
5151
- [Lint source code](#lint-source-code)
@@ -106,20 +106,28 @@ Depending on the labels in the pull requests, the [workflow will result in diffe
106106
- [Colocation of concerns](#colocation-of-concerns)
107107
- [Compatibility](#compatibility)
108108

109-
### Get-Settings
109+
### Plan
110110

111-
[workflow](./.github/workflows/Get-Settings.yml)
111+
[workflow](./.github/workflows/Plan.yml)
112+
113+
The Plan job is the single decision point of the workflow. It runs two steps in sequence:
114+
115+
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.
117+
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.
112119

113120
### Lint-Repository
114121

115122
[workflow](./.github/workflows/Lint-Repository.yml)
116123

117-
### Get settings
124+
### Plan job
118125

119-
[workflow](#get-settings)
120-
- Reads the settings file `github/PSModule.yml` in the module repository to configure the workflow.
126+
[workflow](#plan)
127+
- Reads the settings file `.github/PSModule.yml` in the module repository to configure the workflow.
121128
- 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
122129
to setup testing infrastructure and what operating systems to run the tests on.
130+
- 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.
123131

124132
### Build module
125133

@@ -317,6 +325,7 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
317325
[workflow](./.github/workflows/Publish-Module.yml)
318326
- Publishes the module to the PowerShell Gallery.
319327
- Creates a release on the GitHub repository.
328+
- 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.
320329
- **Abandoned PR cleanup**: When a PR is closed without merging (abandoned), the workflow automatically cleans up any
321330
prerelease versions and tags that were created for that PR. This ensures that abandoned work doesn't leave orphaned
322331
prereleases in the PowerShell Gallery or repository. This behavior is controlled by the `Publish.Module.AutoCleanup`
@@ -430,7 +439,7 @@ This table shows when each job runs based on the trigger scenario:
430439

431440
| Job | Open/Updated PR | Merged PR | Abandoned PR | Manual Run |
432441
| ------------------------- | --------------- | ---------- | ------------ | ---------- |
433-
| **Get-Settings** | ✅ Always | ✅ Always | ✅ Always | ✅ Always |
442+
| **Plan** | ✅ Always | ✅ Always | ✅ Always | ✅ Always |
434443
| **Lint-Repository** | ✅ Yes | ❌ No | ❌ No | ❌ No |
435444
| **Build-Module** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes |
436445
| **Build-Docs** | ✅ Yes | ✅ Yes | ❌ No | ✅ Yes |
@@ -677,7 +686,7 @@ Test:
677686

678687
### Example 2 - Rapid testing
679688

680-
This example ends up running Get-Settings, Build-Module and Test-Module (tests from the module repo) on **ubuntu-latest** only.
689+
This example ends up running Plan, Build-Module and Test-Module (tests from the module repo) on **ubuntu-latest** only.
681690

682691
```yaml
683692
Test:

0 commit comments

Comments
 (0)