From 8151bf403416ea664dbd1759d7423a81813a1f2c Mon Sep 17 00:00:00 2001 From: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com> Date: Sat, 24 Feb 2024 01:53:21 +0300 Subject: [PATCH] Fix workflow (#2859) * Update dotnet.yml * fix syntax * Update dotnet.yml --- .github/workflows/dotnet.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ff72ce73..58086987 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -81,6 +81,7 @@ jobs: env: IsTagBuild: false ArtifactStagingDirectory: "artifacts" + REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json steps: - uses: actions/checkout@v4 @@ -110,16 +111,20 @@ jobs: if: env.IsTagBuild == 'true' run: nuget pack "src/Discord.Net/Discord.Net.nuspec" -OutputDirectory ${{ env.ArtifactStagingDirectory }} + - name: Set API Keys + run: | + nuget setApiKey ${{ secrets.NUGET_API_KEY }} -Source https://api.nuget.org/v3/index.json + nuget setApiKey ${{ secrets.NIGHTLY_FEED_API_KEY }} -Source ${{ vars.NIGHTLY_FEED }} + nuget setApiKey ${{ secrets.GITHUB_TOKEN }} -Source ${{ env.REPOSITORY_URL } + - name: Push Nightly if: vars.PUSH_NIGHTLY == 'true' - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ vars.NIGHTLY_FEED }} -ApiKey ${{ secrets.NIGHTLY_FEED_API_KEY }} + run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ vars.NIGHTLY_FEED }} - name: Push Nightly to GitHub Pacakges - if: vars.PUSH_NIGHTLY == 'true' - env: - REPOSITORY_URL: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ env.REPOSITORY_URL }} -ApiKey ${{ secrets.GITHUB_TOKEN }} + if: vars.PUSH_NIGHTLY == 'true' + run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source ${{ env.REPOSITORY_URL }} - name: Push Release if: env.IsTagBuild == 'true' && vars.PUSH_NUGET == 'true' - run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} + run: nuget push ${{ env.ArtifactStagingDirectory }}/*.nupkg -Source https://api.nuget.org/v3/index.json