-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ps1
51 lines (38 loc) · 1.48 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
44
45
46
47
48
49
50
51
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot
try
{
if ([Environment]::OSVersion.Platform -eq [PlatformID]::Win32NT) {
$Cygwin = "$env:SystemDrive\cygwin64\bin";
if (-not (Test-Path $Cygwin)) {
throw "Cygwin can not be found or not installed."
}
if (($env:Path -split ';') -notcontains $Cygwin) {
$env:Path = $Cygwin + ';' + $env:Path
}
}
$Version = ./get-version.ps1
Write-Host -ForegroundColor Yellow "`r`n#### Test ####`r`n"
dotnet test --verbosity normal
Write-Host -ForegroundColor Yellow "`r`n#### Publish ####"
dir "src/XnaFontTextureGenerator.Desktop/Properties/PublishProfiles/*.pubxml" | %{
$Profile = $_.Basename
Write-Host -ForegroundColor Cyan "`r`n## $Profile ##`r`n"
dotnet publish "src/XnaFontTextureGenerator.Desktop/XnaFontTextureGenerator.Desktop.csproj" `
-p:PublishProfile=$Profile -p:VersionPrefix="$($Version.Prefix)" -p:VersionSuffix="$($Version.Suffix)" -c Release `
-o "build/$Profile" -p:DebugType=None -p:DebugSymbols=false
pushd "build/$Profile"
if ($Profile -like "linux-*") {
tar -cvzf "../xfontgen.$Profile.tgz" *
} elseif ($Profile -like "osx-*") {
tar -acf "../xfontgen.$Profile.zip" *.app
} elseif ($Profile -like "win-*") {
Compress-Archive -Path "*" -DestinationPath "../xfontgen.$Profile.zip" -Force
}
popd
}
}
finally
{
popd
}