Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
partlythomas opened this issue Apr 5, 2024 · 3 comments

Comments

@partlythomas
Copy link

partlythomas commented Apr 5, 2024

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

@SydneyhSmith
Copy link
Collaborator

@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

@partlythomas
Copy link
Author

@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.

@belibug
Copy link

belibug commented May 20, 2024

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.

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

No branches or pull requests

3 participants