-
Notifications
You must be signed in to change notification settings - Fork 4
NuGet Package
Wei Lin edited this page Mar 2, 2026
·
2 revisions
MiniPdf is published to NuGet.org and can be installed via the .NET CLI.
dotnet add package MiniPdf| Property | Value |
|---|---|
| Package ID | MiniPdf |
| Authors | shps951023 |
| License | Apache-2.0 |
| Tags | pdf, excel, xlsx, converter, text, minipdf |
| Repository | https://github.com/shps951023/MiniPdf |
Metadata is defined in src/MiniPdf/MiniPdf.csproj.
Publishing is fully automated via GitHub Actions (nuget-publish.yml).
The workflow runs automatically when a GitHub Release is published.
- Checkout code
- Setup .NET 9.0
dotnet restoredotnet build --configuration Release-
dotnet test— all tests must pass - Extract version from the release tag (e.g.
v0.2.0→0.2.0) -
dotnet packwith the extractedPackageVersion -
dotnet nuget pushto NuGet.org
The main CI workflow (ci.yml) also runs dotnet pack on every push/PR to verify the package can be built correctly.
-
Update the version in
src/MiniPdf/MiniPdf.csproj:<Version>0.2.0</Version> <PackageVersion>0.2.0</PackageVersion>
-
Commit and push to
main -
Create a GitHub Release:
- Go to Releases → Draft a new release
- Create a new tag matching the version:
v0.2.0 - Title:
v0.2.0 - Add release notes (or click "Generate release notes")
- Click Publish release
- The
NuGet Publishworkflow triggers automatically and pushes the package to NuGet.org
| Secret | Description |
|---|---|
NUGET_API_KEY |
NuGet.org API key with Push scope for the MiniPdf package |
- Sign in to https://www.nuget.org
- Go to API Keys → Create
- Set glob pattern to
MiniPdf, scope to Push - Copy the key
- In the GitHub repo: Settings → Secrets and variables → Actions → New repository secret
- Name:
NUGET_API_KEY - Value: paste the key
- Name:
If the CI runner uses .NET 10+, the GetPackOutputItemsTask requires <PackageVersion> to be explicitly defined in the .csproj. Make sure both <Version> and <PackageVersion> are set:
<Version>0.1.0</Version>
<PackageVersion>0.1.0</PackageVersion>The workflow uses --skip-duplicate, so re-publishing the same version is a no-op (not an error).