From 52628c317d0cf550e70e6a339289fa403978a590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Tue, 31 Jan 2023 01:46:37 +0100 Subject: [PATCH] chore(CI): add automatic release (#14) --- .github/workflows/CI.yml | 49 +++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 93c28df..1220a18 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,14 @@ name: CI on: push: - branches: [main] + branches: + # default semantic-release branches + - +([0-9])?(.{+([0-9]),x}).x + - main + - next + - next-major + - beta + - alpha pull_request: schedule: - cron: 0 0 * * 0 @@ -110,3 +117,43 @@ 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-eslint-comments' && + 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: 📥 Install dependencies + run: npm install --legacy-peer-deps + + - 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 a773da3..cc071f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-community/eslint-plugin-eslint-comments", - "version": "3.2.0", + "version": "0.0.0-semantically-released", "description": "Additional ESLint rules for ESLint directive comments.", "engines": { "node": ">=6.5.0"