File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1
1
$output = " ./nupkgs"
2
2
$version = " 0.0.1"
3
3
$publishConfig = " ./nuget/publish-config.json"
4
+
4
5
$json = Get-Content $publishConfig - Raw | ConvertFrom-Json
5
6
6
- Write-Host $json.packagesPaths
7
+ Write-Host " Packages to publish"
8
+ Write-Host " --------------------------------------------------------"
9
+ Write-Host ($json.packagesPaths -join " `n " )
7
10
8
11
dotnet restore
9
12
10
13
dotnet build -- no- restore -- configuration Release
11
14
15
+ if ($LASTEXITCODE -ne 0 )
16
+ {
17
+ throw " dotnet build failed"
18
+ }
19
+
12
20
dotnet test -- no- build -- verbosity normal -- configuration Release
13
21
14
- foreach ( $path in $json.packagesPaths ){
15
- dotnet pack $path -- output $output -- no- build -- configuration Release - p:PackageVersion= $version
22
+ if ($LASTEXITCODE -ne 0 )
23
+ {
24
+ throw " dotnet test failed"
16
25
}
17
26
27
+ foreach ( $path in $json.packagesPaths ){
28
+ $r = dotnet pack $path -- output $output -- no- build -- configuration Release - p:PackageVersion= $version
29
+ }
Original file line number Diff line number Diff line change 1
1
$artifacts = " ./nupkgs"
2
2
$NugetApiKey = " "
3
+ $publishConfig = " ./nuget/publish-config.json"
4
+
5
+ $json = Get-Content $publishConfig - Raw | ConvertFrom-Json
3
6
4
7
$filenames = (Get-ChildItem - Path $artifacts | Select Name).Name
5
8
9
+ $count = $json.packagesPaths.Count
10
+ $actualCount = $filenames.Length
11
+
12
+ if ($count -ne $actualCount )
13
+ {
14
+ throw " Packages count is $count but actual count is $actualCount "
15
+ }
16
+
6
17
foreach ($name in $filenames ){
7
18
dotnet nuget push ./ nupkgs/ $name -- source https:// api.nuget.org/ v3/ index.json -- api- key $NugetApiKey
8
19
}
You can’t perform that action at this time.
0 commit comments