Skip to content

Commit

Permalink
Auto changelog to manifest (#10)
Browse files Browse the repository at this point in the history
* Publish scripts picks up automatically the release notes from the changelog.md

* no message
  • Loading branch information
Sarafian authored Feb 6, 2017
1 parent bdf71e0 commit e085ed0
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions Automation/Publish-Module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ param(
[switch]$ISH13=$false
#>
)
Set-StrictMode -Version latest

$moduleNamesToPublish=@()
switch ($PSCmdlet.ParameterSetName)
{
Expand All @@ -52,14 +54,14 @@ if((& "$PSScriptRoot\Test-All.ps1") -ne 0)
Write-Warning "Tests failed. Stopping..."
return
}

$changeLogPath="$PSScriptRoot\..\CHANGELOG.md"
$changeLog=Get-Content -Path $changeLogPath
if($publishDebug)
{
$revision=0
$date=(Get-Date).ToUniversalTime()
$build=[string](1200 * ($date.Year -2015)+$date.Month*100+$date.Day)
$build+=$date.ToString("HHmm")
$sourceVersion+=".$build.$revision"
}


Expand Down Expand Up @@ -164,6 +166,31 @@ foreach($moduleName in $moduleNamesToPublish)
$psm1Name=$moduleName+".psm1"
$psd1Path=Join-Path $modulePath "$moduleName.psd1"
$guid="c1e7cbac-9e47-4906-8281-5f16471d7ccd"

$possition = "None"
$releaseNotes=foreach ($line in $changelogContent) {
if ($line.StartsWith("**")){
if($possition -eq "None"){
$possition="This Version"
}
else
{
$possition="Next Version"
}
continue
}
If($possition -eq "This Version"){
if($line)
{
$line
}
}
}
$releaseNotes+=@(
""
"https://github.com/Sarafian/ISHServer/blob/master/CHANGELOG.md"
)

$hash=@{
"Author"="SDL plc"
"CompanyName" = "SDL plc"
Expand All @@ -174,7 +201,7 @@ foreach($moduleName in $moduleNamesToPublish)
"Path"=$psd1Path
"LicenseUri"='https://github.com/Sarafian/ISHServer/blob/master/LICENSE'
"ProjectUri"= 'https://github.com/Sarafian/ISHServer/'
"ReleaseNotes"= 'https://github.com/Sarafian/ISHServer/blob/master/CHANGELOG.md'
"ReleaseNotes"= $releaseNotes -join [System.Environment]::NewLine
"CmdletsToExport" = $exportedNames
"FunctionsToExport" = $exportedNames
}
Expand Down

0 comments on commit e085ed0

Please sign in to comment.