From 443db74bdb25d757117b3bec526649ea9783819e Mon Sep 17 00:00:00 2001 From: James Gunn Date: Wed, 4 Oct 2023 15:04:15 +0100 Subject: [PATCH] Update CI workflow for new branch names --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0faa216..dc73a54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,17 +3,25 @@ name: ci on: push: branches: - - master - - release + - dev + - main tags: - v* + paths-ignore: + - LICENSE + - '**.md' pull_request: branches: - - master + - dev + - main + paths-ignore: + - LICENSE + - '**.md' jobs: build: + name: "Build & package" runs-on: ubuntu-latest env: @@ -39,11 +47,24 @@ jobs: - name: Publish package artifact uses: actions/upload-artifact@v2-preview with: - name: package + name: FormFlow.nupkg path: src/FormFlow/bin/Release/*.nupkg - + + + release: + + name: "Release" + runs-on: ubuntu-latest + needs: build + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Download package artifact + uses: actions/download-artifact@v2 + with: + name: FormFlow.nupkg + - name: Publish package to NuGet - if: startsWith(github.ref, 'refs/tags/v') - run: dotnet nuget push src/FormFlow/bin/Release/*.nupkg --api-key ${NUGET_TOKEN} --source https://api.nuget.org/v3/index.json + run: dotnet nuget push **/*.nupkg --api-key $NUGET_TOKEN --source https://api.nuget.org/v3/index.json --skip-duplicate env: - NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} + NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}