-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-notes.ps1
More file actions
43 lines (38 loc) · 1.77 KB
/
Copy pathrelease-notes.ps1
File metadata and controls
43 lines (38 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Generates the nuspec releaseNotes from CHANGELOG.md.
#
# .\release-notes.ps1 # show what would ship, without touching the nuspec
# .\release-notes.ps1 -Preview # the same, including the Unreleased section
# .\release-notes.ps1 -Write # write them into the nuspec
# .\release-notes.ps1 -Check # fail if the nuspec is not what the changelog says
#
# publish.ps1 runs -Check, so a release cannot ship notes that were never regenerated.
#
# The rule the changelog and the store agree on: a top-level bullet whose lead sentence is
# bolded is user-facing and ships; a bullet without a bolded lead stays in the repo. That is
# why the bolded lead has to say what changed and stand on its own — in the store there is no
# paragraph under it and no screenshot beside it.
#
# Everything that is XrmToolBox rather than Plugin Step Codegen lives in the XtbSandbox
# module (github.com/comentality/xrmtoolbox-sandbox), shared with the other tools.
param(
[switch]$Write,
[switch]$Check,
[switch]$Preview
)
$ErrorActionPreference = "Stop"
if (-not (Get-Module -ListAvailable XtbSandbox)) {
throw "XtbSandbox is not installed. Run: Install-Module XtbSandbox -Scope CurrentUser`n(see https://github.com/comentality/xrmtoolbox-sandbox)"
}
Import-Module XtbSandbox
$nuspec = Join-Path $PSScriptRoot "PluginStepCodegen\PluginStepCodegen.nuspec"
$changelog = Join-Path $PSScriptRoot "CHANGELOG.md"
if ($Check) {
Test-XtbReleaseNotes -Nuspec $nuspec -Changelog $changelog
} elseif ($Write) {
Update-XtbReleaseNotes -Nuspec $nuspec -Changelog $changelog | Out-Null
} else {
ConvertTo-XtbReleaseNotes `
-Path $changelog `
-ProjectUrl "https://github.com/comentality/xrm-plugin-step-codegen" `
-IncludeUnreleased:$Preview
}