Skip to content

Commit

Permalink
Merge pull request #64 from Caliburn-Micro/57-using-github-nuget-feed
Browse files Browse the repository at this point in the history
Update nuget.md
  • Loading branch information
vb2ae authored Dec 30, 2024
2 parents 5f85c5a + 0d706cf commit 6c806d6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions documentation/nuget.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,46 @@ namespace YourNamespace
##### WinRT
For WinRT, the process of getting started is unfortunately quite different from the other platforms, due to significant design differences in the Windows Xaml APIs. For detailed instructions please see [Working with WinRT](./windows-runtime).


##### .net Maui
For .net Maui, the process of getting started is unfortunately quite different from the other platforms, due to significant design differences in the Windows Xaml APIs. For detailed instructions please see [Working with WinRT](./dotnet-maui.md).
[nuget]: http://www.nuget.org/


# Using Packages from the GitHub NuGet Feed

## Generating a Token

To use a GitHub NuGet package, you first need to generate a token with permissions to read packages.

1. Log in to GitHub.
2. Navigate to [this page](https://github.com/settings/tokens).

Select the **read:packages** permission. Typically, I set the expiration for a year, but you can choose whatever period suits you best.

![read permissions](../public/images/documentation/github-token-packages.png)

## Adding the NuGet Source

Once you’ve generated the token, use it to add a new NuGet source by running the following command in your terminal:


dotnet nuget add source --username <YourUsername> --password <YourToken> --store-password-in-clear-text --name "Caliburn.Micro GitHub" "https://nuget.pkg.github.com/caliburn.micro/index.json"



## Add nuget source

Once you generate the token you will use it in to call dotnet nuget

dotnet nuget add source --username <Your username> --password <Your token Goes here> --store-password-in-clear-text --name "Caliburn.Micro github" "https://nuget.pkg.github.com/caliburn.micro/index.json"

Replace `<YourUsername>` with your username and `<Your Token Goes here>` with the token you just generated. Feel free to change the name of the source.

## Add the nuget package

To add a package to your project in the folder with the csproj run the following command.

add package Caliburn.Micro.Maui --version 5.0.183-beta --source "https://nuget.pkg.github.com/caliburn-micro/index.json"

[nuget]: http://www.nuget.org/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6c806d6

Please sign in to comment.