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

[Feature Request] Publish docfx prerelease version NuGet packages #9609

Closed
filzrev opened this issue Jan 12, 2024 · 8 comments · Fixed by #9788
Closed

[Feature Request] Publish docfx prerelease version NuGet packages #9609

filzrev opened this issue Jan 12, 2024 · 8 comments · Fixed by #9788
Labels
fundamental Engineering system and core components

Comments

@filzrev
Copy link
Contributor

filzrev commented Jan 12, 2024

Is your feature request related to a problem? Please describe.
Currently it's requires source build to test latest docfx features that is not published to NuGet.

If Nightly CI build package is available.
It can test latest features with CI.
And it can reduce regression risks for users who use non-prerelease version.

Describe the solution you'd like
Publish pre-release version NuGet package.
That supports following target frameworks. (To reduce package size)

  • Latest LTS version (.NET 8)
  • Latest Preview version (.NET 9 Preview)

It's published by GitHub Actions (Daily CI build or published manually with workflow_dispatch).
And older prerelease versions should be cleanup automatically by delete-package-versions action

@yufeih yufeih added the fundamental Engineering system and core components label Jan 13, 2024
@yufeih
Copy link
Contributor

yufeih commented Jan 27, 2024

Unfortunately GH packages in the dotnet org is private only.

@filzrev
Copy link
Contributor Author

filzrev commented Feb 13, 2024

Unfortunately GH packages in the dotnet org is private only.

Thank you for your confirmation.
It seems some packages are publicly published to dotnet organization's GitHub packages.
Though currently settings are changed to private only?.

If there is no alternative way to publish preview NuGet feed. (e.g. MyGet or docascode organization GH packages feed)
It need to manually install preview version of docfx from .nupkg.


.NET 9 Preview 1 is being released today.
So, I am considering the following changes are needed to support .NET9,
What do you think?

  1. Create separate CI workflow that targeting .NET9 and .NET8 (LTS) versions
  2. Publish docfx.nupkg as GitHub Action's artifacts.

Who want to use preview version of docfx needs following steps.

  1. Download nupkg from GitHub Action's artifact page.
  2. Install docfx with dotnet tool install docfx -g --add-source <path to nupkg>

@yufeih
Copy link
Contributor

yufeih commented Feb 16, 2024

@dnfadmin @ChrisSfanos

It seems the dotnet org prohibits publishing public NuGet packages to GitHub packages, yet some packages are published successfully as public such as Silk.NET. Is it possible to make docfx NuGet packages public?

image

@ChrisSfanos
Copy link
Member

Hmm - not sure, but will check offline with some folks and reply back here - thanks

@ChrisSfanos
Copy link
Member

Adding @terrajobst

From Immo:
My understanding is that packages inherit the visibility from the publishing repo. If the repo that pushed the packages is public, then the packages should be public.

How are the packages published?

@filzrev
Copy link
Contributor Author

filzrev commented Mar 14, 2024

Thanks for publishing pre-release packages to GitHub Packages.
I'll try to test latest version of nightly build when packages are published.


It seems GitHub packages requires Personal access tokens even if it is published as public package.
And currently it can't download nupkg from GitHub UI. (https://github.com/orgs/community/discussions/69687)

So it need to use NuGet.config file to install nightly version of docfx package.

Steps to use nightly version of docfx as .NET local tools.

1. Create GitHub Personal access tokens (classic)(PAT) with following permissions

  • read:packages

2. Create NuGet.config file at working directory.

Note: It need to replace %USER_NAME% value to actual GitHub user name.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="github" value="https://nuget.pkg.github.com/dotnet/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <github>
      <add key="Username" value="%USERNAME%" />
      <add key="ClearTextPassword" value="%GITHUB_TOKEN%" />
    </github>
  </packageSourceCredentials>
</configuration>

3. Set PAT to GITHUB_TOKEN environment variable

4. Install docfx as .NET local tools

dotnet tool install docfx --prerelease --create-manifest-if-needed

@filzrev
Copy link
Contributor Author

filzrev commented Mar 16, 2024

It seems nightly-packages are shown on right nav area in docfx repository.
image

This is confusing with nuget published packages.
So it might be better to hide these settings from the navigation pane.
(Settings can be changed using the `Gear' icon in the top right navigation area)

@martincostello
Copy link
Member

I would agree that the use of GitHub Packages for the pre-release packages here isn't a good user experience - the need to mess about with credentials to get the packages to restore isn't practically workable across the many repositories I'm testing prereleases within a GitHub Enterprise Server instance.

I would suggest publishing them to another platform such as feedz.io that does support true anonymous access (I use package source mappings so I need to declare another feed anyway, regardless of credentials) or just publishing the pre-release versions directly to NuGet.org.

I'll stick with DOTNET_ROLL_FORWARD: LatestMajor and DOTNET_ROLL_FORWARD_TO_PRERELEASE, though the new --allow-roll-forward flag for dotnet tool restore might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fundamental Engineering system and core components
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants