-
Notifications
You must be signed in to change notification settings - Fork 100
Single step multiple project-nuget Deploy. #61
base: master
Are you sure you want to change the base?
Conversation
Fixes brandedoutcast#41. This adds 2 dependencies to publish-nuget that then allows file globbing support for ``PROJECT_FILE_PATH`` and then allows pushing them.
I had to fix #56 as it is required for this to perform right (it could result in a performance issue if all nuget packages gets nuked every time the changes tries to push any package after the first one that matches in the glob. |
@brandedoutcast mind reviewing this and seeing if this will work. |
Had to add SOLUTION_FILE_PATH and PACKAGE_PATH to fix it.
let tmp = this.projectFile | ||
glob.on('include', function (file) { | ||
this.projectFile = file.relative | ||
this.versionFile = file.relative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was with you on every thing in the PR but this. Rather than mutating the current instance of the Action, make this a pure method, passing project and version into _run_internal
as parameters.
Also, what if the version file is not the project file? What if the version is indicated in a .nuspec file? That was the intent of the versionfile property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with file globbing is well the following:
- user uses file globbing for project file path (
'**/*.csproj'
) - user uses file globbing for nuspec files (usually using nuspec files manually is not wanted by developers as they tend to go outdated fast and so they trick the .NET SDK to generate them instead).
For the nuspec case I think one could glob for them but then one would have to:
- filter the
include
event betweencsproj
andnuspec
files.
I guess there is an easier way to process the events and process the include event if I check if versionFile
specifies an glob pattern and then resolve those first, then resolve the project globs and then pass them in properly.
But this results in other issues:
- what if some projects do not use nuspec, but some do on the same repository all of which package up packages to be published
- what would prevent a bug where the file globbing to fix the nuspec issue ends up resulting in it not wanting to read the
version
that is embedded in the projects (csprojs) that do not have a nuspec file paired with it?
Because of this many projects actually define the versions in the actual project files then tell the .NET SDK to pass that version property from msbuild on over to the nuget command line where then it is used to build the package (Microsoft's own SourceGenerator and Analyzer packages do this btw).
Anyways I recommend defining the version in:
- the project file
- the project's version of
Directory.Build.props
Fixes #41.
Fixes #56.
This adds 2 dependencies to publish-nuget that then allows file globbing support for
PROJECT_FILE_PATH
and then allows pushing them.