From 9aa6afd5b1ad9d88936b2cdcc657d2c07f1e7221 Mon Sep 17 00:00:00 2001 From: ioan-ghisoi-cko Date: Tue, 14 Jul 2026 11:01:12 +0100 Subject: [PATCH] ci: auto-bump patch version on merge to main --- .github/workflows/cd.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 21aab02..946d0fc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,6 +8,9 @@ on: branches: - main +permissions: + contents: write + jobs: test-and-coverage: runs-on: ubuntu-latest @@ -25,12 +28,33 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} verbose: true - publish-npm: + bump-version: if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} needs: test-and-coverage runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 21 + - name: Bump patch version and push + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + npm version patch -m "chore(release): v%s [skip ci]" + git push origin HEAD:main --follow-tags + + publish-npm: + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + needs: bump-version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main - uses: actions/setup-node@v4 with: node-version: 21