Skip to content

Force exit when failing to create NuGet packages - #7847

Merged
aparajit-pratap merged 1 commit into
DynamoDS:masterfrom
ellensi:NuGet
May 8, 2017
Merged

aparajit-pratap merged 1 commit into
DynamoDS:masterfrom
ellensi:NuGet

Conversation

@ellensi

@ellensi ellensi commented May 4, 2017 •

Copy link
Copy Markdown
Contributor

Purpose

When the command nuget pack fails to create nupkg files from nuspec files, the build should fail. Only one failure should be enough to stop the build, i.e., the build should only pass if nuget pack succeeds for all the packages.

Note: This build step will only be done if "Upload Nuget Packages" is checked when triggering the build.

Reasons to do this:

  • So that we can notice when a file that needs to be published has gone missing for any reason.
  • So that all packages on www.nuget.org must be coming from the same build and aligned to have the same build number.

This PR should prevent the following successful build to happen, there were 6 nuspec files but only 5 nupkg files were created:

Could Not Find E:\Dynamo\tools\NuGet\*.nupkg

Attempting to build package from 'DynamoVisualProgramming.Core.nuspec'.
Successfully created package 'E:\Dynamo\tools\NuGet\DynamoVisualProgramming.Core.1.3.0.nupkg'.
Attempting to build package from 'DynamoVisualProgramming.DynamoCoreNodes.nuspec'.
File not found: 'Display.xml'.
Attempting to build package from 'DynamoVisualProgramming.DynamoServices.nuspec'.
Successfully created package 'E:\Dynamo\tools\NuGet\DynamoVisualProgramming.DynamoServices.1.3.0.nupkg'.
Attempting to build package from 'DynamoVisualProgramming.Tests.nuspec'.
Successfully created package 'E:\Dynamo\tools\NuGet\DynamoVisualProgramming.Tests.1.3.0.nupkg'.
Attempting to build package from 'DynamoVisualProgramming.WpfUILibrary.nuspec'.
Successfully created package 'E:\Dynamo\tools\NuGet\DynamoVisualProgramming.WpfUILibrary.1.3.0.nupkg'.
Attempting to build package from 'DynamoVisualProgramming.ZeroTouchLibrary.nuspec'.
Successfully created package 'E:\Dynamo\tools\NuGet\DynamoVisualProgramming.ZeroTouchLibrary.1.3.0.nupkg'.

Pushing DynamoVisualProgramming.Core 1.3.0 to the NuGet gallery (https://www.nuget.org)...
Your package was pushed.
Pushing DynamoVisualProgramming.DynamoServices 1.3.0 to the NuGet gallery (https://www.nuget.org)...
Your package was pushed.
Pushing DynamoVisualProgramming.Tests 1.3.0 to the NuGet gallery (https://www.nuget.org)...
Your package was pushed.
Pushing DynamoVisualProgramming.WpfUILibrary 1.3.0 to the NuGet gallery (https://www.nuget.org)...
Your package was pushed.
Pushing DynamoVisualProgramming.ZeroTouchLibrary 1.3.0 to the NuGet gallery (https://www.nuget.org)...
Your package was pushed.

This log file was taken and modified from here.

Reviewers

@DynamoEngOps

FYIs

@aparajit-pratap

@aparajit-pratap

Copy link
Copy Markdown
Contributor

Thanks @ellensi for fixing this. So I understand that now it will be an all or none situation where only if all .nupkg files are generated, will they be pushed to NuGet or if even one of them fails, then none are posted. Am I right?

@aparajit-pratap
aparajit-pratap merged commit 0afec25 into DynamoDS:master May 8, 2017
@mjkkirschner

Copy link
Copy Markdown
Member

did this PR also fix the broken nuget upload?

@ellensi

ellensi commented May 9, 2017

Copy link
Copy Markdown
Contributor Author

@aparajit-pratap Yes, exactly. I have updated the PR description to reflect this info. Thanks for merging.

@mjkkirschner Which broken nuget upload are you referring to?

@aparajit-pratap

Copy link
Copy Markdown
Contributor

@mjkkirschner this should fix the NuGet upload issue. I will post the Nuget package for DynamoCoreNodes today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants