Skip to content

Commit

Permalink
#60 Add Release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
colinangusmackay committed Jan 8, 2021
1 parent de9c93e commit d7e4921
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Reset-WipReleaseNotes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$content = @(
"# Release Notes",
"",
"## Version X",
"",
"Date: ???",
""
"### Bugs"
"",
"### Features",
"",
"### Miscellaneous",
""
)

Set-Content "$PSScriptRoot/release-notes/wip-release-notes.md" $content -Encoding UTF8 -Force
40 changes: 40 additions & 0 deletions build-release-notes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$fullVersion = $Env:STRAVAIG_PACKAGE_FULL_VERSION

$currentReleaseNotes = Get-Content "$PSScriptRoot/release-notes/wip-release-notes.md";

for($i = 0; $i -lt $currentReleaseNotes.Length; $i++)
{
$line = $currentReleaseNotes[$i];
if ($line -eq "## Version X")
{
$line = "## Version $fullVersion"
$currentReleaseNotes[$i] = $line;
}

if ($line -eq "Date: ???")
{
$line = "Date: "+(Get-Date).ToString("dddd, d MMMM, yyyy 'at' HH:mm:ss zzzz")
$currentReleaseNotes[$i] = $line;
}
}

Set-Content "$PSScriptRoot/release-notes/release-notes-$fullVersion.md" $currentReleaseNotes -Encoding UTF8 -Force

$fullReleaseNotes = Get-Content "$PSScriptRoot/release-notes/full-release-notes.md";

$preamble = $fullReleaseNotes[0..1];

$currentReleaseNotesExtractLength = $currentReleaseNotes.Length - 1;
$currentReleaseNotesExtract = $currentReleaseNotes[2..$currentReleaseNotesExtractLength]

$existingLength = $fullReleaseNotes.Length - 1;
$existing = $fullReleaseNotes[2..$existingLength];

$fullReleaseNotes = $preamble + $currentReleaseNotesExtract + $existing

Set-Content "$PSScriptRoot/release-notes/full-release-notes.md" $fullReleaseNotes -Encoding UTF8 -Force

$contributors = Get-Content "$PSScriptRoot/contributors.md";
$releaseBody = $currentReleaseNotes + @("", "---", "") + $contributors
Set-Content "$PSScriptRoot/release-body.md" $releaseBody -Encoding UTF8 -Force

4 changes: 4 additions & 0 deletions release-notes/full-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Full Release Notes



13 changes: 13 additions & 0 deletions release-notes/wip-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Release Notes

## Version X

Date: ???

### Bugs

### Features

### Miscellaneous

* #60: Make build and release process consistent with other Stravaig Projects.

0 comments on commit d7e4921

Please sign in to comment.