PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Make it possible to include repository url and type in generated nuspec file

Open partlythomas opened this issue 10 months ago • 3 comments

Summary of the new feature / enhancement

It should be possible somehow in the Publish-PSResource cmdlet to have the repository element with attributes type and url defined in the generated Nuspec file in order to link a package to a repository in GitHub during publishing of a package. Similar to how RepositoryUrl is used when pushing a package with the dotnet cli and a csproj file.

As far as I can tell, this linking of a package to a repository must be done manually after publishing a package today.

References: https://docs.github.com/en/[email protected]/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry

https://devblogs.microsoft.com/nuget/introducing-source-code-link-for-nuget-packages/

Proposed technical implementation details (optional)

No response

partlythomas avatar Apr 05 '24 13:04 partlythomas

@partlythomas we have the ProjectUri element in the psd1 that usually links to a GitHub repo, is that what you are looking for, would you want this to connect to the repository element in the nuspec? What are you looking for with the type attribute?

https://learn.microsoft.com/en-us/nuget/reference/nuspec#repository

SydneyhSmith avatar Apr 05 '24 17:04 SydneyhSmith

@partlythomas we have the ProjectUri element in the psd1 that usually links to a GitHub repo, is that what you are looking for, would you want this to connect to the repository element in the nuspec? What are you looking for with the type attribute?

https://learn.microsoft.com/en-us/nuget/reference/nuspec#repository

Good point, I missed that - Yes I want that to connect to the repository element - If it makes sense. The type part was just mentioned as it is a required (?) specification of the element: https://learn.microsoft.com/en-us/nuget/reference/nuspec#repository

The end goal is that I want a published module or script to automatically link to a repository when using GitHub Packages NuGet feed as the destination repository. I am not fully sure if linking the RepositoryUri element to the nuspec repository element would achieve that.

partlythomas avatar Apr 10 '24 13:04 partlythomas

I was able to create recreate this,

  1. created nupkg using PSRresourceGet
  2. Unpackage it, add "repository" element in nuspec and pack it back to nupkg
  3. push it github registry It links the nupkg to respective github repo.

We can either reuse ProjectUri in psd1 or have another parameter that accepts repo url. I would prefer reading ProjectUri field.

belibug avatar May 20 '24 20:05 belibug