Add functionality for release notes in module

This commit is contained in:
Wes Carroll
2019-04-05 13:58:29 -04:00
parent b9e5d069b6
commit 1f1b5b9d94
2 changed files with 26 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
* New Feature 1
* New Feature 2
* New SubFeature 1
* What is happening???
+20
View File
@@ -91,6 +91,8 @@ task UpdateMarkdownHelp CheckPlatyPSInstalled, {
task CreatePsd1ForRelease CleanTemp, {
$functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName }
$releaseNotes = "# {0}{1}" -f $version, $(Get-Content .\RELEASENOTES.md -Raw)
$ManifestParams = @{
Path = "$BuildRoot\temp\ZertoApiWrapper.psd1"
RootModule = 'ZertoApiWrapper.psm1'
@@ -108,6 +110,7 @@ task CreatePsd1ForRelease CleanTemp, {
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @()
ReleaseNotes = $releaseNotes
}
New-ModuleManifest @ManifestParams
}
@@ -156,6 +159,23 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, {
Add-Content -Path $psm1Path -Value "Export-ModuleMember -Function $exportString"
}
task CreateArtifacts CleanPublish, CreateModule, {
if (-not $(Test-Path "$BuildRoot\publish")) {
New-Item -Path $BuildRoot -Name "publish" -ItemType Directory
}
Compress-Archive -Path .\temp\* -DestinationPath .\publish\ZertoApiWrapper.zip
Get-Module -Name ZertoApiWrapper | Remove-Module -Force
Import-Module .\temp\ZertoApiWrapper.psd1 -Force
(Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt
(Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt
}
task CleanPublish {
if ($(Test-Path "$BuildRoot\publish")) {
Remove-Item -Recurse -Path "$BuildRoot\publish\*"
}
}
task CreateModule CleanTemp, FileTests, AnalyzeBuiltFiles, BuildMamlHelp, {
}