-
-
Notifications
You must be signed in to change notification settings - Fork 147
/
pack.ps1
57 lines (46 loc) · 1.86 KB
/
pack.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
52
53
54
55
56
57
param (
[string]$version = "1.0.0",
[switch]$push = $false,
[Switch]$skipbuild = $false,
[string]$apikey = "",
[string]$source = "nuget.org"
)
# ##############################################
# ##### URANIUMUI PACKING AND PUBLISHING #######
# ##############################################
# Usage:
# 1. Run this script in a powershell terminal:
#
# .\pack.ps1 <version> -push <nuget-api-key>
#
# Example:
#
# .\pack.ps1 2.3.3 -push abcdefeysomeapikeyherefromnugetabcdef
#
# ##############################################
if (!$skipbuild) {
Write-Host "UraniumUI packages packing started."
Invoke-Expression "dotnet pack -c Release -o . -p:packageVersion=$version --include-symbols"
Write-Host "UraniumUI packages packing completed."
}
if ($push) {
Write-Host "UraniumUI packages pushing started."
Invoke-Expression "dotnet nuget push '*.$version.symbols.nupkg' --api-key $apikey --skip-duplicate --source $source"
Write-Host "UraniumUI packages has been pushed successfully." -ForegroundColor Green
}
Set-Location ./templates
if (!$skipbuild) {
Write-Host "UraniumUI templates packing started."
Invoke-Expression "dotnet pack -c Release -o . -p:packageVersion=$version --include-symbols"
Write-Host "UraniumUI templates packing completed."
}
if ($push) {
Write-Host "UraniumUI templates pushing started."
Invoke-Expression "dotnet nuget push '*.$version.symbols.nupkg' --api-key $apikey --skip-duplicate --source $source"
Write-Host "UraniumUI templates has been pushed successfully." -ForegroundColor Green
Write-Host "Removing nupkg files..."
Write-Host "Nupkg files has been removed successfully." -ForegroundColor Green
}
Set-Location ../ # back to root
Invoke-Expression "Remove-Item -Path '*.nupkg' -Force -Recurse"
Invoke-Expression "Remove-Item -Path '**\*.nupkg' -Force -Recurse"