forked from TheJoeFin/Text-Grab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-x64.ps1
45 lines (40 loc) · 1.25 KB
/
build-x64.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
$BuildPath = "$PSScriptRoot\bld\x64"
$BuildPathSC = "$PSScriptRoot\bld\x64\Text-Grab-Self-Contained"
$Version = Get-Date -Format "yyyy-MM-dd" # 2020-11-1
$VersionDot = $Version -replace '-','.'
$Project = "Text-Grab"
$Archive = "$BuildPath\$Project-$Version.zip"
$ArchiveSC = "$BuildPath\$Project-Self-Contained-$Version.zip"
# Clean up
if(Test-Path -Path $BuildPath)
{
Remove-Item $BuildPath -Recurse
}
# Dotnet restore and build
dotnet publish "$PSScriptRoot\$Project\$Project.csproj" `
--runtime win-x64 `
--self-contained false `
-c Release `
-v minimal `
-o $BuildPath `
-p:PublishReadyToRun=true `
-p:PublishSingleFile=true `
-p:CopyOutputSymbolsToPublishDirectory=false `
-p:Version=$VersionDot `
--nologo
# Archive Build
Compress-Archive -Path "$BuildPath\$Project.exe" -DestinationPath $Archive
# Dotnet restore and build
dotnet publish "$PSScriptRoot\$Project\$Project.csproj" `
--runtime win-x64 `
--self-contained true `
-c Release `
-v minimal `
-o $BuildPathSC `
-p:PublishReadyToRun=true `
-p:PublishSingleFile=true `
-p:CopyOutputSymbolsToPublishDirectory=false `
-p:Version=$VersionDot `
--nologo
# Archive Build
Compress-Archive -Path "$BuildPathSC" -DestinationPath $ArchiveSC