From d2dd52ea700316db862e0431446610daa66e6bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Thu, 13 Oct 2022 02:40:00 +0200 Subject: [PATCH] chore(CI): add automatic release --- .github/workflows/CI.yml | 45 ++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 00e26624..8dff446b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,6 +1,14 @@ name: CI on: push: + branches: + # default semantic-release branches + - +([0-9])?(.{+([0-9]),x}).x + - main + - next + - next-major + - beta + - alpha pull_request: jobs: @@ -75,3 +83,40 @@ jobs: - name: ⬆️ Upload coverage report uses: codecov/codecov-action@v3 + + release: + name: 🚀 Release + needs: [lint, test] + runs-on: ubuntu-latest + if: + github.repository == 'eslint-community/eslint-plugin-promise' && + contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha', + github.ref) && github.event_name == 'push' + steps: + - name: 🛑 Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: ⎔ Setup node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: 🚀 Release + uses: cycjimmy/semantic-release-action@v3 + with: + semantic_version: 19 + branches: | + [ + '+([0-9])?(.{+([0-9]),x}).x', + 'main', + 'next', + 'next-major', + {name: 'beta', prerelease: true}, + {name: 'alpha', prerelease: true} + ] + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index b7903191..7ca4fa6f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-promise", - "version": "6.0.2", + "version": "0.0.0-semantically-released", "description": "Enforce best practices for JavaScript promises", "keywords": [ "eslint",