Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Single step multiple project-nuget Deploy. #61

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

AraHaan
Copy link
Contributor

@AraHaan AraHaan commented May 19, 2021

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.

AraHaan added 2 commits May 19, 2021 04:54
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.
@AraHaan
Copy link
Contributor Author

AraHaan commented May 19, 2021

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.

@AraHaan
Copy link
Contributor Author

AraHaan commented May 19, 2021

@brandedoutcast mind reviewing this and seeing if this will work.

AraHaan added 2 commits May 19, 2021 10:22
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

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.

Copy link
Contributor Author

@AraHaan AraHaan May 23, 2021

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 between csproj and nuspec 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Sequential build and publish deleting nuget packages [FEATURE] Multiple Nuget Deploy, 1 Step
2 participants