-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild-nupkgs.ps1
36 lines (31 loc) · 1000 Bytes
/
build-nupkgs.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
$VersionSuffix = "0.0.1-nightly-20200725"
function dotnet-build {
if ($VersionSuffix.Length -gt 0) {
dotnet build -c Release --version-suffix $VersionSuffix
}
else {
dotnet build -c Release
}
}
function dotnet-pack {
Get-ChildItem -Path "src\**\*.csproj" | ForEach-Object {
if(!"$_".contains("Blazor")) {
if ($VersionSuffix.Length -gt 0) {
dotnet pack $_ -c Release --no-build --output nupkgs\$VersionSuffix --version-suffix $VersionSuffix
}
else {
dotnet pack $_ -c Release --no-build --output nupkgs
}
}
}
}
function dotnet-nuget-push {
dotnet nuget push nupkgs\$VersionSuffix\*.nupkg -k "APIKEY" -s https://nuget.cdn.azure.cn/v3/index.json -t 360 --skip-duplicate
}
@( "dotnet-build", "dotnet-pack", "dotnet-nuget-push" ) | ForEach-Object {
echo ""
echo "***** $_ *****"
echo ""
&$_
if ($LastExitCode -ne 0) { Exit $LastExitCode }
}