From ad097c88f2372a038c0f242982d0a982899808d5 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Wed, 27 Dec 2023 23:07:41 +0000 Subject: [PATCH] Push to NuGet (#18) --- .github/workflows/dotnet.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml index 337da6b..1d44f36 100644 --- a/.github/workflows/dotnet.yaml +++ b/.github/workflows/dotnet.yaml @@ -165,3 +165,22 @@ jobs: runs-on: ubuntu-latest steps: - run: echo "All required checks complete." + + nuget-publish: + runs-on: ubuntu-latest + if: ${{ !github.event.repository.fork && github.ref == 'refs/heads/main' }} + needs: [all-required-checks-complete] + environment: main-deploy + steps: + - uses: actions/checkout@v4 + - name: Install Nix + uses: cachix/install-nix-action@v24 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Download NuGet artifact + uses: actions/download-artifact@v4 + with: + name: nuget-package + - name: Publish to NuGet + run: nix develop --command dotnet nuget push "WoofWare.Myriad.Plugins.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json