Skip to content

Commit ea410a3

Browse files
committed
📝 [docs] Updates publishing instructions
Updates the publishing documentation and workflow to remove the `-ReadMe` parameter from the `Publish-Module` command. - 📝 [docs] Removes the `-ReadMe` parameter from `Publish-Module` in the publishing documentation. - The metadata normalization script now handles embedding the README, license, and icon into the staged `.nupkg` package. - Simplifies the `Publish-Module` command in documentation examples for PowerShell Gallery, GitHub Packages, and private feeds. - 👷 [ci] Removes the `-ReadMe` parameter from the `Publish-Module` command in the GitHub Actions workflow. - Relies on the metadata normalization script to bundle the README file into the NuGet package. Signed-off-by: Nick2bad4u <[email protected]>
1 parent 329e512 commit ea410a3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ jobs:
233233
}
234234
235235
try {
236-
Publish-Module -Path ./ColorScripts-Enhanced -Repository $repoName -NuGetApiKey 'LocalRepositoryKey' -ReadMe $readmePath -ErrorAction Stop | Out-Null
236+
Publish-Module -Path ./ColorScripts-Enhanced -Repository $repoName -NuGetApiKey 'LocalRepositoryKey' -ErrorAction Stop | Out-Null
237237
}
238238
finally {
239239
Unregister-PSRepository -Name $repoName -ErrorAction SilentlyContinue

docs/Publishing.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ The PowerShell Gallery is built on top of NuGet feeds. Publishing to the Gallery
2121

2222
```powershell
2323
# Publish to the PowerShell Gallery (NuGet.org)
24-
Publish-Module -Path ./ColorScripts-Enhanced -NuGetApiKey $env:PSGALLERY_API_KEY -ReadMe ./ColorScripts-Enhanced/README.md -Verbose
24+
Publish-Module -Path ./ColorScripts-Enhanced -NuGetApiKey $env:PSGALLERY_API_KEY -Verbose
2525
```
2626

27-
If you stage the package locally with `Publish-Module` (for example by targeting a temporary repository), run the metadata normalizer before pushing:
27+
PowerShellGet versions prior to 2.2.6 do not embed README or license assets automatically. When you stage the package locally with `Publish-Module` (for example by targeting a temporary repository), run the metadata normalizer before pushing:
2828

2929
```powershell
3030
pwsh -NoProfile -File ./scripts/Update-NuGetPackageMetadata.ps1 -PackagePath 'C:\path\to\ColorScripts-Enhanced.<version>.nupkg'
@@ -38,7 +38,7 @@ The GitHub publish workflow runs this script automatically.
3838
1. Create an account at <https://www.powershellgallery.com>.
3939
2. Generate an API key from your profile.
4040
3. Store the key securely (e.g., GitHub secret `PSGALLERY_API_KEY`).
41-
4. Ensure `README.md` is present in the module root (`ColorScripts-Enhanced/README.md`). When `Publish-Module` runs with `-ReadMe`, it embeds the file so the online gallery renders it automatically.
41+
4. Ensure `README.md` is present in the module root (`ColorScripts-Enhanced/README.md`). The metadata normalization script bundles this file (along with `LICENSE` and the icon) into the staged `.nupkg` prior to publishing.
4242

4343
### Testing Before Publishing
4444

@@ -74,7 +74,9 @@ GitHub Packages provides a private or public NuGet feed.
7474
$owner = 'Nick2bad4u'
7575
$source = "https://nuget.pkg.github.com/$owner/index.json"
7676
Register-PSRepository -Name GitHub -SourceLocation $source -PublishLocation $source -InstallationPolicy Trusted -PackageManagementProvider NuGet
77-
Publish-Module -Path ./ColorScripts-Enhanced -NuGetApiKey $env:PACKAGES_TOKEN -Repository GitHub -ReadMe ./ColorScripts-Enhanced/README.md
77+
Publish-Module -Path ./ColorScripts-Enhanced -NuGetApiKey $env:PACKAGES_TOKEN -Repository GitHub
78+
79+
> **Tip:** When you stage the package locally before pushing to GitHub Packages, run `Update-NuGetPackageMetadata.ps1` against the resulting `.nupkg` so the README, license, and icon are embedded.
7880
```
7981

8082
### Installing from GitHub Packages
@@ -91,7 +93,9 @@ For enterprise environments you can host the module in Azure Artifacts or any Nu
9193

9294
```powershell
9395
Register-PSRepository -Name MyCompanyFeed -SourceLocation 'https://pkgs.dev.azure.com/<org>/<project>/_packaging/<feed>/nuget/v2' -InstallationPolicy Trusted -Credential (Get-Credential)
94-
Publish-Module -Path ./ColorScripts-Enhanced -Repository MyCompanyFeed -ReadMe ./ColorScripts-Enhanced/README.md
96+
Publish-Module -Path ./ColorScripts-Enhanced -Repository MyCompanyFeed
97+
98+
> **Tip:** Normalize staged packages with `Update-NuGetPackageMetadata.ps1` before pushing them to your private feed to ensure gallery-friendly metadata.
9599
```
96100

97101
## Release Workflow Summary

0 commit comments

Comments
 (0)