forked from TEdit/Terraria-Map-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
43 lines (33 loc) · 1.22 KB
/
build.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
param(
[string] $VersionPrefix = "4.5.1",
[string] $VersionSuffix
)
$buildArgs = @(
"publish",
"-c"
"Release"
".\src\TEdit.sln",
'/p:signcert="BC Code Signing"')
$filename = "TEdit-$VersionPrefix"
if ($null -ne $VersionPrefix) {
$buildArgs += "/p:VersionPrefix=""$VersionPrefix"""
}
if ($null -ne $VersionSuffix) {
$buildArgs += "/p:VersionSuffix=""$VersionSuffix"""
$filename = "TEdit-$VersionPrefix-$VersionSuffix"
}
& dotnet $buildArgs
Remove-Item -Path ".\release" -Recurse -Force
Remove-Item -Path ".\TEdit*.zip"
Remove-Item -Path ".\TEdit*.msi"
mkdir -Path ".\release"
Copy-Item -Path ".\src\TEdit\bin\Release\net462\publish" -Destination ".\release\$filename\" -Recurse -Force
Copy-Item -Path ".\schematics" -Destination ".\release" -Recurse
# Create Installer
# $env:VERSION_PREFIX = $VersionPrefix
# $env:VERSION_SUFFIX = $VersionSuffix
# & dotnet build -c Release ".\src\Setup\Setup.csproj"
# signtool.exe sign /v /fd sha256 /n "BC Code Signing" /t http://timestamp.digicert.com ".\src\Setup\$filename.msi"
# Move-Item ".\src\Setup\$filename.msi" ".\"
# Create ZIP Release
Compress-Archive -Path ".\release\*" -DestinationPath ".\$filename.zip"