Skip to content

Commit

Permalink
Don't push packages to GitHub package registry
Browse files Browse the repository at this point in the history
Too much hassle to consume since it doesn't allow anonymous access, so
anyone wanting to consume these packages, even if the packages are
public, would have to set up NuGet auth and a GitHub API key.
  • Loading branch information
rmunn committed Aug 15, 2024
1 parent f378c99 commit 8438cd6
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/nuget-ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,21 @@ jobs:
name: nuget-packages
path: src/artifacts/package/release/*nupkg

- name: Publish package to GitHub
if: github.event_name == 'pull_request' || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads'))
shell: bash
run: |
dotnet nuget push "src/artifacts/package/release/*.symbols.nupkg" -s https://nuget.pkg.github.com/sillsdev/index.json -k "$NUGET_API_KEY" --skip-duplicate
env:
NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package to NuGet.org
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
shell: bash
run: |
echo Would run the following:
echo dotnet nuget push "src/artifacts/package/release/*nupkg" --skip-duplicate --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: fake-key-for-testing-purposes
# NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}
# Not using the GitHub package registry right now, since it doesn't allow anonymous access so it's a hassle to use

# - name: Publish package to GitHub
# if: github.event_name == 'pull_request' || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads'))
# shell: bash
# run: |
# dotnet nuget push "src/artifacts/package/release/*.symbols.nupkg" -s https://nuget.pkg.github.com/sillsdev/index.json -k "$NUGET_API_KEY" --skip-duplicate
# env:
# NUGET_API_KEY: ${{ secrets.GITHUB_TOKEN }}

# - name: Publish package to NuGet.org
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# shell: bash
# run: |
# echo Would run the following:
# echo dotnet nuget push "src/artifacts/package/release/*nupkg" --skip-duplicate --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json
# env:
# NUGET_API_KEY: ${{ secrets.SILLSDEV_PUBLISH_NUGET_ORG }}

0 comments on commit 8438cd6

Please sign in to comment.