Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit 8d9607e

Browse files
committed
Added publish NuGet pkgs script
1 parent 8bc0900 commit 8d9607e

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Publish-Release.ps1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
param (
2+
[Parameter(Mandatory=$true)][string]$apiKey
3+
)
4+
5+
$branch = invoke-expression "git branch --show-current"
6+
7+
if ($branch -ne 'master') {
8+
Write-Error "Publishing only allowed from master branch"
9+
exit
10+
}
11+
12+
$projPaths = @(
13+
"."
14+
)
15+
16+
# Ensure everything is built
17+
Write-Verbose "Pack projects"
18+
$projPaths | %{
19+
write-host "" # separator
20+
dotnet pack -c Release $_
21+
}
22+
23+
# Publish to NuGet
24+
Write-Verbose "Publish projects"
25+
$projPaths | %{
26+
write-host "" # separator
27+
$pkg = gci $_/bin/Release *.nupkg
28+
dotnet nuget push -k $apiKey $pkg.FullName -s https://api.nuget.org/v3/index.json
29+
}

0 commit comments

Comments
 (0)