From 0f8c13ac79bce0541c1e52f8ff2a538cb9055efb Mon Sep 17 00:00:00 2001 From: Alexey Raga Date: Tue, 22 Nov 2022 22:53:12 +1100 Subject: [PATCH] Publish package --- .github/workflows/ci.yaml | 68 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0998a6f..fc14d42 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -88,40 +88,38 @@ jobs: name: packages-${{ matrix.os }}-net${{ matrix.dotnet }} path: ${{ github.workspace }}/packages/**/*.nupkg + release: + runs-on: ubuntu-latest + needs: [ git-version, build ] + if: github.ref == 'refs/heads/main' + + + steps: + - name: Get packages for publishing + uses: actions/download-artifact@v3 + id: download + with: + name: packages-ubuntu-latest-net6.x + path: packages + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: "6.x" + + - name: Publish packages + run: dotnet nuget push ${{ github.workspace }}/packages/**/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json -# release: -# runs-on: ubuntu-latest -# needs: [ git-version, build ] -# if: github.ref == 'refs/heads/main' -# -# -# steps: -# - name: Get packages for publishing -# uses: actions/download-artifact@v3 -# id: download -# with: -# name: packages-ubuntu-latest-net6.x -# path: packages -# -# - uses: actions/setup-dotnet@v3 -# with: -# dotnet-version: "6.x" -# -# - name: Publish packages -# run: dotnet nuget push ${{ github.workspace }}/packages/**/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json -# -# - name: Create tag -# id: create_tag -# uses: anothrNick/github-tag-action@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# CUSTOM_TAG: v${{ needs.git-version.outputs.MajorMinorPatch }} -# -# - name: Create release -# uses: ncipollo/release-action@v1 -# with: -# name: Release ${{ needs.git-version.outputs.MajorMinorPatch }} -# tag: ${{ steps.create_tag.outputs.tag }} -# token: ${{ secrets.GITHUB_TOKEN }} -# generateReleaseNotes: true + - name: Create tag + id: create_tag + uses: anothrNick/github-tag-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CUSTOM_TAG: v${{ needs.git-version.outputs.MajorMinorPatch }} + + - name: Create release + uses: ncipollo/release-action@v1 + with: + name: Release ${{ needs.git-version.outputs.MajorMinorPatch }} + tag: ${{ steps.create_tag.outputs.tag }} + token: ${{ secrets.GITHUB_TOKEN }} + generateReleaseNotes: true