From 04623c8d41444e2e6f54d5ddb7ac89c86e220d97 Mon Sep 17 00:00:00 2001 From: "Michael A. Hawker" Date: Sat, 14 Oct 2023 23:21:47 -0700 Subject: [PATCH] Add release step in CI for pushing to NuGet.org --- .github/workflows/build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a108ecb..a41a59b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,3 +101,28 @@ jobs: - name: Uninstall Template working-directory: ./ run: dotnet new uninstall Mikeware.GoDotNet.BlankTemplate + + release: + if: ${{ startsWith(github.ref, 'refs/heads/rel/') }} + needs: [Build-Template-Package] + runs-on: ubuntu-latest + + steps: + - name: Install .NET SDK v${{ env.DOTNET_VERSION }} + uses: actions/setup-dotnet@v3.2.0 + with: + dotnet-version: ${{ env.DOTNET_VERSION }} + + - name: Download signed packages for ${{ matrix.platform }} + uses: actions/download-artifact@v3.0.2 + with: + name: nuget-package + path: ./template + + - name: Push to NuGet.org + run: > + dotnet nuget push + ./template/**/*.nupkg + --source https://api.nuget.org/v3/index.json + --api-key ${{ secrets.NUGET_PACKAGE_PUSH_TOKEN }} + --skip-duplicate