|
| 1 | +<# |
| 2 | + .SYNOPSIS |
| 3 | + Tasks for releasing modules. |
| 4 | +
|
| 5 | + .PARAMETER OutputDirectory |
| 6 | + The base directory of all output. Defaults to folder 'output' relative to |
| 7 | + the $BuildRoot. |
| 8 | +
|
| 9 | + .PARAMETER BuiltModuleSubdirectory |
| 10 | + The parent path of the module to be built. |
| 11 | +
|
| 12 | + .PARAMETER VersionedOutputDirectory |
| 13 | + If the module should be built using a version folder, e.g. ./MyModule/1.0.0. |
| 14 | + Defaults to $true. |
| 15 | +
|
| 16 | + .PARAMETER ChangelogPath |
| 17 | + The path to and the name of the changelog file. Defaults to 'CHANGELOG.md'. |
| 18 | +
|
| 19 | + .PARAMETER ReleaseNotesPath |
| 20 | + The path to and the name of the release notes file. Defaults to 'ReleaseNotes.md'. |
| 21 | +
|
| 22 | + .PARAMETER ProjectName |
| 23 | + The project name. |
| 24 | +
|
| 25 | + .PARAMETER ModuleVersion |
| 26 | + The module version that was built. |
| 27 | +
|
| 28 | + .PARAMETER GalleryApiToken |
| 29 | + The module version that was built. |
| 30 | +
|
| 31 | + .PARAMETER NuGetPublishSource |
| 32 | + The source to publish nuget packages. Defaults to https://www.powershellgallery.com. |
| 33 | +
|
| 34 | + .PARAMETER PSModuleFeed |
| 35 | + The name of the feed (repository) that is passed to command Publish-Module. |
| 36 | + Defaults to 'PSGallery'. |
| 37 | +
|
| 38 | + .PARAMETER SkipPublish |
| 39 | + If publishing should be skipped. Defaults to $false. |
| 40 | +
|
| 41 | + .PARAMETER PublishModuleWhatIf |
| 42 | + If the publish command will be run with '-WhatIf' to show what will happen |
| 43 | + during publishing. Defaults to $false. |
| 44 | +
|
| 45 | + .PARAMETER ChocolateyBuildOutput |
| 46 | + Sub-Folder (or absolute path) of the Chocolatey build output folder (relative |
| 47 | + to $OutputDirectory). Contain the path to one or more Chocolatey packages. |
| 48 | + This variable $ChocolateyBuildOutput also used to determine if the repository |
| 49 | + is building a Chocolatey package. Defaults to 'choco'. |
| 50 | +#> |
| 51 | + |
1 | 52 | param
|
2 | 53 | (
|
3 |
| - # Base directory of all output (default to 'output') |
4 | 54 | [Parameter()]
|
5 | 55 | [string]
|
6 | 56 | $OutputDirectory = (property OutputDirectory (Join-Path $BuildRoot 'output')),
|
|
46 | 96 |
|
47 | 97 | [Parameter()]
|
48 | 98 | [string]
|
49 |
| - # Sub-Folder (or absolute path) of the Chocolatey build output folder (relative to $OutputDirectory) |
50 |
| - # Contain the path to one or more Chocolatey packages. |
51 |
| - # This variable here is used to determine if the repository is building a Chocolatey package. |
52 | 99 | $ChocolateyBuildOutput = (property ChocolateyBuildOutput 'choco')
|
53 | 100 | )
|
54 | 101 |
|
@@ -159,6 +206,7 @@ task Create_changelog_release_output {
|
159 | 206 | }
|
160 | 207 | }
|
161 | 208 |
|
| 209 | +# Synopsis: Publish Nuget package to a gallery. |
162 | 210 | task publish_nupkg_to_gallery -if ($GalleryApiToken -and (Get-Command -Name 'nuget' -ErrorAction 'SilentlyContinue')) {
|
163 | 211 | # Get the vales for task variables, see https://github.com/gaelcolas/Sampler#task-variables.
|
164 | 212 | . Set-SamplerTaskVariable
|
@@ -272,6 +320,7 @@ task package_module_nupkg {
|
272 | 320 | $null = Unregister-PSRepository -Name output -ErrorAction SilentlyContinue
|
273 | 321 | }
|
274 | 322 |
|
| 323 | +# Synopsis: Publish a built PowerShell module to a gallery. |
275 | 324 | task publish_module_to_gallery -if ($GalleryApiToken -and (Get-Command -Name 'Publish-Module' -ErrorAction 'SilentlyContinue')) {
|
276 | 325 | # Get the vales for task variables, see https://github.com/gaelcolas/Sampler#task-variables.
|
277 | 326 | . Set-SamplerTaskVariable
|
|
0 commit comments