diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b2a24b..e6726c9 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 @@ -50,7 +57,49 @@ jobs: - name: 📥 Install dependencies run: npm install + - name: 🏗 Build + run: npm run build + - name: ▶️ Run test script run: npm run test - name: ⬆️ Upload coverage report uses: codecov/codecov-action@v3 + + release: + name: 🚀 Release + needs: [lint, test] + runs-on: ubuntu-latest + if: github.repository == 'eslint-community/regexpp' && + 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 + + - 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 07d083b..17cc8fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-community/regexpp", - "version": "3.2.0", + "version": "0.0.0-semantically-released", "description": "Regular expression parser for ECMAScript.", "engines": { "node": ">=8"