Skip to content

Commit

Permalink
Dont push same release twice (#32)
Browse files Browse the repository at this point in the history
* Don't push to nuget.org if a package with same release number is already listed

* Fix vscode warnings about aliases

* Add dist folder to .gitignore

* Add packages dir to build cache
  • Loading branch information
Tomas Lycken authored Oct 30, 2017
1 parent 5694b2d commit fb3fb0b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ bin
obj
packages
test_results
dist

.vs
.vscode

*.user
*.user
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ image: Visual Studio 2017
environment:
NUGET_API_KEY:
secure: eEi8gt5ne+a+N5fYINa2DqF7DCqOzYCE5udL5XzZm2qhcaMJkg9Tg4d0QObF9s3L
cache: src/packages
init:
- git config --global core.autocrlf true
dotnet_csproj:
Expand Down
22 changes: 18 additions & 4 deletions deploy-nugets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@ if ((gitversion /showvariable prereleaselabel) -eq "feat") {
return;
}
mkdir dist
$artifacts.keys | % { $artifacts[$_]['sourcePath'] } | ? { $_ -notlike '*.symbols.nupkg' } | Copy-Item -Destination dist
$packages = ls dist | select -ExpandProperty FullName | ? { $_ -notlike '*.symbols.nupkg' }
$packages | % { dotnet nuget push $_ -k $env:NUGET_API_KEY -sk $env:NUGET_API_KEY -s https://nuget.org/api/v2/package -ss https://nuget.smbsrc.net/ }
if ($LastExitCode -ne 0) { throw; }

$artifacts.keys `
| ForEach-Object { $artifacts[$_]['sourcePath'] } `
| Where-Object { $_ -notlike '*.symbols.nupkg' } `
| Copy-Item -Destination dist
$packages = Get-ChildItem dist `
| Select-Object -ExpandProperty FullName `
| Where-Object { $_ -notlike '*.symbols.nupkg' }

$pushed = nuget list RdbmsEventStore `
| Select-Object @{ Name="FileName"; Expression = { "$($_.Replace(" ", ",")).nupkg" } } `
| Select-Object -ExpandProperty FileName

$packages `
| Where-Object { ($_ | Split-Path -Leaf) -notin $pushed } `
| ForEach-Object { dotnet nuget push $_ -k $env:NUGET_API_KEY -sk $env:NUGET_API_KEY -s https://nuget.org/api/v2/package -ss https://nuget.smbsrc.net/ }

if ($LastExitCode -ne 0) { throw; }

0 comments on commit fb3fb0b

Please sign in to comment.