-
Notifications
You must be signed in to change notification settings - Fork 2
/
Create-Release.ps1
61 lines (42 loc) · 1.79 KB
/
Create-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
param(
[ValidateSet('Rebuild','Build', 'Clean')]
[string]$build = "Rebuild",
[ValidateSet('Debug', 'Release')]
[string]$config = "Release",
[bool] $BumpVersion = $true
)
function Write-Diagnostic {
param([string]$message)
Write-Host
Write-Host $message -ForegroundColor Green
Write-Host
}
$rootFolder = split-path -parent $MyInvocation.MyCommand.Definition
$scriptsFolder = Join-Path $rootFolder "script"
$binaries = "$rootFolder\bin\"
if (Test-Path $binaries) { Remove-Item $binaries -Recurse -Force }
Write-Diagnostic "Bootstrapping environment"
. $scriptsFolder\bootstrap.ps1
if ($BumpVersion) {
Write-Diagnostic "Increment version of libraries"
. $scriptsFolder\Bump-Version.ps1 -Increment Patch
}
Write-Diagnostic "Building solution"
. $scriptsFolder\Build-Solution.ps1 -Project "$rootFolder\src\Shimmer.sln" `
-Build $build -Config $config
Write-Diagnostic "Recreating the CreateReleasePackage package"
Write-Host "Because of a limitation in the auto-generated NuGet package"
Write-Host "I need to re-compile the CreateReleasePackage tool now"
Write-Host "passing the magic parameter -Tool so that the project reference"
Write-Host "goes away"
. $rootFolder\src\.nuget\NuGet.exe pack $rootFolder\src\CreateReleasePackage\CreateReleasePackage.csproj -Tool -OutputDirectory $rootFolder\bin\ -Verbosity quiet -NoPackageAnalysis
if (Test-Path $binaries) {
Remove-Item "$rootFolder\bin\Shimmer.Tests.*.nupkg"
Remove-Item "$rootFolder\bin\Shimmer.WiXUi.*.nupkg"
}
Write-Diagnostic "Running all the tests"
. $scriptsFolder\Run-UnitTests.ps1
. $scriptsFolder\Run-PowershellTests.ps1
rm ${env:LOCALAPPDATA}\Shimmer\ProjectWithContent*
rm ${env:LOCALAPPDATA}\Shimmer\SampleUpdatingApp*
rm ${env:LOCALAPPDATA}\Shimmer\theApp*