From 51b3ff2915facd26bc5358e837368c4451370901 Mon Sep 17 00:00:00 2001 From: Simon Mika Date: Thu, 23 Apr 2026 19:57:47 +0200 Subject: [PATCH 1/2] Switched to publish before version bump. Co-authored-by: Copilot --- .github/workflows/bump-alpha.yml | 20 --------- .github/workflows/bump-beta.yml | 20 --------- .github/workflows/bump-common.yml | 68 ------------------------------- .github/workflows/bump.yml | 45 ++++++++++++++++++++ .github/workflows/publish.yml | 18 ++++---- 5 files changed, 53 insertions(+), 118 deletions(-) delete mode 100644 .github/workflows/bump-alpha.yml delete mode 100644 .github/workflows/bump-beta.yml delete mode 100644 .github/workflows/bump-common.yml create mode 100644 .github/workflows/bump.yml diff --git a/.github/workflows/bump-alpha.yml b/.github/workflows/bump-alpha.yml deleted file mode 100644 index 49822dc..0000000 --- a/.github/workflows/bump-alpha.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "Bump Alpha" - -on: - push: - branches: - - "master-2" - -concurrency: - group: bump-alpha-${{ github.ref_name }} - cancel-in-progress: false - -jobs: - bump-alpha: - uses: ./.github/workflows/bump-common.yml - with: - bump_name: "Bump Alpha" - default_bump: "prerelease" - preid: "alpha" - rc_wording: "" - tag_prefix: "prerelease-" diff --git a/.github/workflows/bump-beta.yml b/.github/workflows/bump-beta.yml deleted file mode 100644 index 8c76d66..0000000 --- a/.github/workflows/bump-beta.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: "Bump Minor" - -on: - push: - branches: - - "master" - -concurrency: - group: bump-minor-${{ github.ref_name }} - cancel-in-progress: false - -jobs: - bump-minor: - uses: ./.github/workflows/bump-common.yml - with: - bump_name: "Bump Minor" - major_wording: "breaking:" - minor_wording: "feature:" - patch_wording: "fix:" - tag_prefix: "release-" diff --git a/.github/workflows/bump-common.yml b/.github/workflows/bump-common.yml deleted file mode 100644 index b0d5138..0000000 --- a/.github/workflows/bump-common.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: "Bump Common" - -on: - workflow_call: - inputs: - bump_name: - required: true - type: string - default_bump: - required: false - type: string - default: "" - preid: - required: false - type: string - default: "" - major_wording: - required: false - type: string - default: "" - minor_wording: - required: false - type: string - default: "" - patch_wording: - required: false - type: string - default: "" - rc_wording: - required: false - type: string - default: "" - tag_prefix: - required: false - type: string - default: "release-" - -jobs: - bump: - name: ${{ inputs.bump_name }} - timeout-minutes: 60 - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: "Checkout source code" - uses: actions/checkout@v4 - with: - ref: ${{ github.sha }} - fetch-depth: 0 - token: ${{ github.token }} - - - name: "Bump version" - uses: phips28/gh-action-bump-version@v11.0.7 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - default: ${{ inputs.default_bump }} - preid: ${{ inputs.preid }} - major-wording: ${{ inputs.major_wording }} - minor-wording: ${{ inputs.minor_wording }} - patch-wording: ${{ inputs.patch_wording }} - rc-wording: ${{ inputs.rc_wording }} - tag-prefix: ${{ inputs.tag_prefix }} - bump-policy: last-commit - check-last-commit-only: true - target-branch: ${{ github.ref_name }} - commit-message: "ci: version bump to v{{version}} [skip ci]" diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml new file mode 100644 index 0000000..a386b66 --- /dev/null +++ b/.github/workflows/bump.yml @@ -0,0 +1,45 @@ +name: "Bump" + +on: + workflow_run: + workflows: + - "Publish" + types: + - completed + branches: + - "master" + - "master-2" + - "master-beta" + +concurrency: + group: bump-${{ github.event.workflow_run.head_branch }} + cancel-in-progress: false + +jobs: + bump: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + name: "Bump Version" + timeout-minutes: 60 + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: "Checkout source code" + uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_branch }} + fetch-depth: 0 + token: ${{ github.token }} + + - name: "Bump version" + uses: phips28/gh-action-bump-version@v11.0.7 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + default: "${{ (github.event.workflow_run.head_branch == 'master-2' || github.event.workflow_run.head_branch == 'master-beta') && 'prerelease' || 'minor' }}" + preid: "${{ github.event.workflow_run.head_branch == 'master-2' && 'alpha' || (github.event.workflow_run.head_branch == 'master-beta' && 'beta' || '') }}" + tag-prefix: "release-" + bump-policy: last-commit + check-last-commit-only: true + target-branch: ${{ github.event.workflow_run.head_branch }} + commit-message: "ci: version bump to v{{version}} [skip ci]" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8f96f41..4bceadb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,14 @@ name: "Publish" on: - workflow_run: - workflows: - - "Bump Alpha" - - "Bump Minor" - types: - - completed + push: + branches: + - "master" + - "master-2" + - "master-beta" concurrency: - group: publish-${{ github.event.workflow_run.head_branch }} + group: publish-${{ github.ref_name }} cancel-in-progress: false permissions: @@ -19,14 +18,13 @@ permissions: jobs: publish: name: "Publish" - if: ${{ github.event.workflow_run.conclusion == 'success' }} timeout-minutes: 60 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.workflow_run.head_sha }} + ref: ${{ github.sha }} - uses: actions/setup-node@v4 with: node-version: 22 @@ -34,4 +32,4 @@ jobs: registry-url: "https://registry.npmjs.org" - run: npm ci - run: npm run build - - run: npm publish --tag "${{ github.event.workflow_run.name == 'Bump Minor' && 'latest' || (github.event.workflow_run.name == 'Bump Alpha' && 'alpha' || 'beta') }}" --access public --provenance + - run: npm publish --tag "${{ github.ref_name == 'master-2' && 'alpha' || (github.ref_name == 'master-beta' && 'beta' || 'latest') }}" --access public --provenance From ad8331961232bcef45fbb193541dcaa04f3a47bf Mon Sep 17 00:00:00 2001 From: Simon Mika Date: Thu, 23 Apr 2026 19:58:36 +0200 Subject: [PATCH 2/2] Fixed version naming convention. --- .github/workflows/bump.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index a386b66..edfed59 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -42,4 +42,4 @@ jobs: bump-policy: last-commit check-last-commit-only: true target-branch: ${{ github.event.workflow_run.head_branch }} - commit-message: "ci: version bump to v{{version}} [skip ci]" + commit-message: "ci: version bump to {{version}} [skip ci]" diff --git a/package.json b/package.json index d0cd636..ff8fc62 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ } }, "git": { - "tagName": "v${version}" + "tagName": "release-${version}" }, "github": { "release": true