From 8438cd6fe11462d383493e512c4fae66a4fd6995 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 15 Aug 2024 13:58:37 +0700 Subject: [PATCH] Don't push packages to GitHub package registry 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. --- .github/workflows/nuget-ci-cd.yml | 35 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/nuget-ci-cd.yml b/.github/workflows/nuget-ci-cd.yml index 45cca88..2231fe3 100644 --- a/.github/workflows/nuget-ci-cd.yml +++ b/.github/workflows/nuget-ci-cd.yml @@ -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 }}