forked from HearthSim/Hearthstone-Deck-Tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build-Release.ps1
24 lines (20 loc) · 871 Bytes
/
Build-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
$assemblyVersion = Get-Content "Hearthstone Deck Tracker\Properties\AssemblyInfo.cs" |
where { $_ -match '\[assembly: AssemblyVersion\("([\.\d]+)"\)\]' } |
foreach { $matches[1] }
if ($assemblyVersion.EndsWith(".0")) {
$assemblyVersion = $assemblyVersion.Substring(0, $assemblyVersion.Length - 2)
}
$baseDir = "Hearthstone Deck Tracker\Releases"
$targetDir = "$baseDir\v$assemblyVersion"
if (Test-Path $targetDir) {
echo "build_release.ps1: build error 1: directory '$targetDir' already exists"
return
}
msbuild /p:Configuration=Release
msbuild /p:Configuration=Squirrel
mkdir $targetDir
cp "$baseDir\RELEASES" $targetDir
cp "$baseDir\Setup.exe" "$targetDir\HDT-Installer.exe"
cp "$baseDir\*-delta.nupkg" $targetDir
cp "$baseDir\*$assemblyVersion-full.nupkg" $targetDir
cp "$baseDir\Hearthstone.Deck.Tracker-v$assemblyVersion.zip" $targetDir