Skip to content

Commit

Permalink
Publish NuGet package to GitHub Registry
Browse files Browse the repository at this point in the history
only on develop branch.
  • Loading branch information
mus65 committed Nov 19, 2024
1 parent 5933063 commit 4d756d4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,29 @@ jobs:
with:
name: Coverlet Results Windows
path: coverlet

Publish:
runs-on: ubuntu-24.04
if: github.ref == 'refs/heads/develop'
permissions:
packages: write
needs:
- Windows
- Linux
steps:
- name: Download NuGet Package
uses: actions/download-artifact@v4
with:
name: NuGet Package

- name: Publish to GitHub NuGet Registry
run: |
dotnet nuget add source \
--username $GITHUB_ACTOR \
--password ${{ secrets.GITHUB_TOKEN }} \
--store-password-in-clear-text \
--name github \
"https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json"
dotnet nuget push "*.nupkg" \
--source github \
--api-key ${{ secrets.GITHUB_TOKEN }}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,19 @@ Private keys in OpenSSH key format can be encrypted using one of the following c

The library has no special requirements to build, other than an up-to-date .NET SDK. See also [CONTRIBUTING.md](https://github.com/sshnet/SSH.NET/blob/develop/CONTRIBUTING.md).

## Using Pre-Release NuGet Package

If you need an unreleased bugfix or feature, you can use the Pre-Release NuGet packages from the `develop` branch which are published to the [GitHub NuGet Registry](https://github.com/sshnet/SSH.NET/pkgs/nuget/SSH.NET).
In order to pull packages from the registry you first have to create a Personal Access Token with the `read:packages` permissions. Then add a NuGet Source for SSH.NET:

Note: you may have to add `--store-password-in-clear-text` on non-Windows platforms.

```
dotnet nuget add source --name SSH.NET --username <username> --password <personalaccesstoken> https://nuget.pkg.github.com/sshnet/index.json
```

Then you can add the the package as desribed [here](https://github.com/sshnet/SSH.NET/pkgs/nuget/SSH.NET).

## Supporting SSH.NET

Do you or your company rely on **SSH.NET** in your projects? If you want to encourage us to keep on going and show us that you appreciate our work, please consider becoming a [sponsor](https://github.com/sponsors/sshnet) through GitHub Sponsors.

0 comments on commit 4d756d4

Please sign in to comment.