-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathpack-nuget.ps1
More file actions
33 lines (27 loc) · 1.66 KB
/
Copy pathpack-nuget.ps1
File metadata and controls
33 lines (27 loc) · 1.66 KB
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
Write-Host @"
███╗ ██╗██╗ ██╗ ██████╗ ███████╗████████╗
████╗ ██║██║ ██║██╔════╝ ██╔════╝╚══██╔══╝
██╔██╗ ██║██║ ██║██║ ███╗█████╗ ██║
██║╚██╗██║██║ ██║██║ ██║██╔══╝ ██║
██║ ╚████║╚██████╔╝╚██████╔╝███████╗ ██║
╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═╝
"@
$revision = git describe --always --tags --exclude latest
if ($revision -match '^(\d+\.\d+\.\d+)(?:-(\d+)(?:-g[0-9a-f]+)?)?$') {
$baseVersion = $matches[1]
$commitCount = $matches[2]
if ($commitCount) {
$revision = "$baseVersion-preview$commitCount"
} else {
$revision = $baseVersion
}
} else {
throw "Unsupported git describe output: '$revision'. Expected 'x.y.z' or 'x.y.z-N-g<sha>'."
}
Write-Host "NuGet Package Version: $revision"
Set-Location ..\ # Move to the root of the project
powershell -ExecutionPolicy Bypass -File "Scripts\update-version.ps1"
dotnet pack -c Release -p:PackageVersion=$revision -o .\Build -p:PreBuildEvent="" QuickLook.Common\QuickLook.Common.csproj
dotnet pack -c Release -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg -p:PackageVersion=$revision -o .\Build -p:PreBuildEvent="" QuickLook.Common\QuickLook.Common.csproj
# Write-Host "`nPress any key to exit..."
# [void][System.Console]::ReadKey($true)