From b5af013599ad431d72e1868b9403f17d40b18e4f Mon Sep 17 00:00:00 2001 From: Brian Surowiec Date: Mon, 26 Oct 2020 06:16:21 -0400 Subject: [PATCH 1/2] Split the ci workflow into two This will keep the ci build numbers low since every pr build was increasing them --- .github/workflows/ci.yml | 14 ++-------- .github/workflows/pull_request.yml | 44 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c64af3..917d8ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,8 @@ name: CI on: - pull_request: push: - branches: - - main + branches: [main] env: DOTNET_NOLOGO: true @@ -15,15 +13,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repo + - name: Checkout repository uses: actions/checkout@v2.3.3 - - name: Build pr suffix - if: github.event_name == 'pull_request' - run: echo "VERSION_SUFFIX=alpha.${{ github.event.number }}" >> $GITHUB_ENV - - - name: Build ci suffix - if: github.event_name == 'push' + - name: Build version suffix run: echo "VERSION_SUFFIX=beta.${{ github.run_number }}" >> $GITHUB_ENV - name: Setup Node @@ -57,5 +50,4 @@ jobs: path: ./artifacts/* - name: Publish to GPR - if: github.event_name == 'push' run: dotnet nuget push ./artifacts/*.nupkg --no-symbols true --api-key ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..32ffa1e --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,44 @@ +name: Pull Request + +on: pull_request + +env: + DOTNET_NOLOGO: true + NODE_VERSION: "14.x" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.3 + + - name: Build version suffix + run: echo "VERSION_SUFFIX=alpha.${{ github.event.number }}" >> $GITHUB_ENV + + - name: Setup Node + uses: actions/setup-node@v2.1.2 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Setup .NET Core (3.1.x) + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: '3.1.x' + + - name: Setup .NET Core (global.json) + uses: actions/setup-dotnet@v1.7.2 + + - run: npm ci + + - run: dotnet build --configuration Release + + - run: dotnet test --configuration Release --no-build + + - run: dotnet pack --configuration Release --output ./artifacts --version-suffix $VERSION_SUFFIX + + - name: Publish artifacts + uses: actions/upload-artifact@v2.2.0 + with: + path: ./artifacts/* From 806e060171b62a420a213c20ee1c44eaac86c1c3 Mon Sep 17 00:00:00 2001 From: Brian Surowiec Date: Mon, 26 Oct 2020 06:48:15 -0400 Subject: [PATCH 2/2] Add build status badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 557a50f..7b00a0c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # heroicons-tag-helper +[![CI build status](https://github.com/xt0rted/heroicons-tag-helper/workflows/CI/badge.svg)](https://github.com/xt0rted/heroicons-tag-helper/actions?query=workflow%3ACI) [![GitHub Package Registry](https://img.shields.io/badge/github-package_registry-yellow?logo=nuget)](https://nuget.pkg.github.com/xt0rted/index.json) [![Project license](https://img.shields.io/github/license/xt0rted/heroicons-tag-helper)](LICENSE)