From efd1445a42a35f77e9939f338abc002e1a035b40 Mon Sep 17 00:00:00 2001 From: Gabriel Guerrero Date: Thu, 21 Mar 2024 21:26:47 +0000 Subject: [PATCH] ci(build.yaml): support N.x branches to patch previous release --- .github/workflows/build.yml | 5 +++-- .releaserc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5933284e..ce428fa3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,7 @@ name: Node.js CI on: push: - branches: [ main, next, beta ] + branches: [ main, next, beta, '*.x' ] pull_request: branches: '*' @@ -32,7 +32,8 @@ jobs: publish: runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta' }} + # only allows semantic release on main, next, beta, and 1*x branches, github doesnt do regex matching so we have to manually when we are over version 20 + if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/beta' || (startsWith(github.ref, 'refs/heads/1') && endsWith(github.ref, '.x')) }} needs: [quality] steps: - uses: actions/checkout@v2 diff --git a/.releaserc b/.releaserc index 36d44cd3..54553a77 100644 --- a/.releaserc +++ b/.releaserc @@ -1,5 +1,5 @@ { - "branches": ["main", "next", {"name": "beta", "prerelease": true}], + "branches": ['+([0-9])?(.{+([0-9]),x}).x', "main", "next", {"name": "beta", "prerelease": true}], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator",