-
Notifications
You must be signed in to change notification settings - Fork 0
/
package_release.ps1
46 lines (37 loc) · 1.41 KB
/
package_release.ps1
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
44
45
46
# Prepare a release package for upload to github
#
# DOES NOT BUILD OR TEST.
#
# Process is:
#
# * In visual studio, edit timeboxer/Properties/AssemblyInfo.cs to set the version number
# * Make sure the README talks about the latest features
# * commit the changes made above and tag
# * clone the repo to a temp workdir
# * in the temp clone, rebuild project in Release Build (to check all needed files are committed)
# * Test that you can drag the .exe someplace else and start it from there
# * run this script. It reads the version resource from the exe and uses it to update the readme and to name the zipfile. It removes and replaces the Staging/ folder
# * Github things
#
$version = (Get-Item .\Timeboxer\bin\Release\Timeboxer.exe).VersionInfo.FileVersionRaw
Remove-Item -Recurse .\Staging
$null = New-Item .\Staging -ItemType Directory
$null = New-Item .\Staging\Timeboxer -ItemType Directory
$line = 0
(Get-Content .\README.md) |
Foreach-Object {
if ($line -eq 0)
{
$_ + " " + $version
$line=1
} elseif ($line -eq 1) {
$_ + "========"
$line=2
} else {
$_ # send the current line to output
}
} | Set-Content .\Staging\Timeboxer\README.md
Copy-Item .\Timeboxer\bin\Release\Timeboxer.exe .\Staging\Timeboxer
Set-Location .\Staging
Compress-Archive .\Timeboxer -DestinationPath Timeboxer-$version.zip
Set-Location ..