Skip to content

Commit dc78ee2

Browse files
Document shared package ownership and tested version binding
1 parent aa86256 commit dc78ee2

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎.github/actions/Publish-PSModule/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Publishes a pre-versioned, tested PowerShell module artifact to the PowerShell Gallery after source-bound ownership preflight. GitHub Release creation is handled by the separate [Release-PSModule](../Release-PSModule/README.md) action.
44

5-
The publisher verifies the original source, exact resolved tag/version, producing repository/PR or direct-release context, and tested bytes before an external versioned-artifact mutation. An absent version is reserved with a create-only annotated tag containing the file-tree and ZIP SHA-256 proof. Existing tags are never updated or deleted.
5+
The publisher verifies the original source, exact resolved tag/version, producing repository/PR or direct-release context, and tested bytes before an external versioned-artifact mutation. An absent Gallery module/version is reserved at `PSModule-Publication/<lowercase-module>/<lowercase-version>`, independently of the configured release-tag prefix. The shared coordinate and release tag reference the same immutable annotated source/context/file-tree/ZIP claim. Existing tags are never updated or deleted; the package ownership coordinate is retained for immutable Gallery proof.
66

77
An existing Gallery package is retained only when its raw nupkg payload matches that proof and the tested artifact. Package code is never imported to establish ownership. Unknown legacy proof, foreign tags/releases/assets, changed claims, authentication errors, and API failures stop publication explicitly.
88

@@ -15,6 +15,7 @@ An existing Gallery package is retained only when its raw nupkg payload matches
1515
| `ArtifactName` | Name of the module artifact to download. | No | `module` |
1616
| `PSGALLERY_API_KEY` | PowerShell Gallery API key. | Yes | N/A |
1717
| `ReleaseTag` | Exact tag already resolved as `Publish.Module.Resolution.FullVersion`. | Yes | N/A |
18+
| `VersionPrefix` | Existing resolver prefix used to bind `ReleaseTag` to the tested module version. | No | `v` |
1819
| `CommitSha` | Immutable commit that produced the tested artifact. | No | Original workflow `GITHUB_SHA` |
1920
| `PullRequest` | Normalized producing-PR context; empty for a direct stable release. | No | Empty |
2021
| `WhatIf` | Logs publishing operations without publishing the module. | No | `false` |
@@ -35,10 +36,13 @@ This action does not provide outputs.
3536
ArtifactName: module
3637
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
3738
ReleaseTag: ${{ fromJson(inputs.Settings).Publish.Module.Resolution.FullVersion }}
39+
VersionPrefix: ${{ fromJson(inputs.Settings).Publish.Module.VersionPrefix }}
3840
CommitSha: ${{ fromJson(inputs.Settings).Context.CommitSha }}
3941
PullRequest: ${{ toJson(fromJson(inputs.Settings).Context.PullRequest) }}
4042
```
4143
4244
Provide `GH_TOKEN` with contents-write access scoped to the consumer repository. The reusable workflow supplies its existing GitHub App token and resolved context internally.
4345

46+
NuGet-reserved container metadata paths are rejected in the tested candidate before a claim or upload, using the same path classification as raw package verification. A published package without its shared module/version coordinate is unproven; the publisher does not fabricate that ownership record on retry.
47+
4448
Use [Release-PSModule](../Release-PSModule/README.md) in a separate step to create the GitHub release from the same source and tested artifact. A retry must retain the original coordinates and bytes; unproven legacy publication requires reviewed forward-only recovery, not numeric guessing, retagging, or metadata changes.

‎.github/actions/Release-PSModule/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Creates or resumes a GitHub release for a pre-versioned, tested PowerShell modul
1010
| `ModulePath` | Path containing the built `<Name>/` module directory. | No | `.PSModule/module` |
1111
| `ArtifactName` | Name of the module artifact to download. | No | `module` |
1212
| `ReleaseTag` | Full GitHub release tag resolved by `Resolve-PSModuleVersion`. | Yes | N/A |
13+
| `VersionPrefix` | Existing configured resolver prefix; verifies tag/artifact version binding. | No | `v` |
1314
| `CommitSha` | Original immutable build source for stable and prerelease tags. | No | Original workflow `GITHUB_SHA` |
1415
| `PullRequest` | Normalized producing-PR context; empty for a direct stable release. | No | Empty |
1516
| `WhatIf` | Logs release operations without creating or uploading anything. | No | `false` |
@@ -38,12 +39,13 @@ Pass the Plan job's resolved `FullVersion` as `ReleaseTag` so the configured tag
3839
ModulePath: .PSModule/module
3940
ArtifactName: module
4041
ReleaseTag: ${{ fromJson(inputs.Settings).Publish.Module.Resolution.FullVersion }}
42+
VersionPrefix: ${{ fromJson(inputs.Settings).Publish.Module.VersionPrefix }}
4143
CommitSha: ${{ fromJson(inputs.Settings).Context.CommitSha }}
4244
PullRequest: ${{ toJson(fromJson(inputs.Settings).Context.PullRequest) }}
4345
```
4446
4547
The action supports normalized pull-request context and direct stable releases. Provide repository-scoped contents-write `GH_TOKEN` access and the original tested artifact/source. Tags resolve to actual commits, including annotated tags; mutable branch names and release target hints are not ownership proof.
4648

47-
Release creation and upload recheck the tag, provenance, and artifact identity. A missing upload can resume. An existing asset is retained only when its published SHA-256 matches the exact local ZIP; differing, ambiguous, or unverifiable bytes stop the action. Uploads never use `--clobber`, and tags are never retargeted.
49+
Release creation and upload recheck the release tag, shared module/version coordinate, provenance, and artifact identity. Both refs must bind the same immutable claim, regardless of tag prefix. A missing upload can resume. An existing asset is retained only when its published SHA-256 matches the exact local ZIP; differing, ambiguous, or unverifiable bytes stop the action. Uploads never use `--clobber`, and tags are never retargeted.
4850

4951
Complete authored or generated prerelease notes precede a final repository/producing-PR/source footer. A matching tag/source does not authorize another PR's release. Legacy records without proof require reviewed forward-only recovery; the action does not fabricate provenance or alter consumer metadata.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ Release names and notes can be generated from the pull request — see
7777

7878
Before taking a Gallery version, the publisher verifies the immutable consumer source, the Plan job's exact
7979
resolved version/tag, the producing repository/PR or direct-release context, and the tested module bytes.
80-
An absent version tag is reserved with a create-only annotated claim containing the tested file-tree and
81-
release-ZIP SHA-256 digests. Existing tags are not updated or deleted.
80+
The Gallery module/version is reserved at a prefix-independent `PSModule-Publication/<module>/<version>`
81+
coordinate, and the configured release tag references that same immutable annotated claim. It records the
82+
source/context, tested file-tree and release-ZIP SHA-256 digests. The resolver's existing prefix must bind
83+
the tag to the tested artifact version. Existing tags are not updated or deleted.
8284

8385
Standalone tags, annotated tags, releases, provenance footers, module assets, and exact Gallery packages must
8486
agree with that claim. Raw nupkg files are read without importing package code. Verified absence is different
8587
from an authentication/API failure or unknown ownership proof; errors and unavailable proof stop publication.
88+
NuGet-reserved container paths are rejected in the tested candidate before claiming or uploading, rather
89+
than being discarded only when verifying a published package.
8690

8791
The publisher rechecks the claim and tested files immediately before Gallery upload. GitHub release creation
8892
and upload repeat the ownership checks. Missing uploads may resume, identical published ZIP bytes are retained,

0 commit comments

Comments
 (0)