From 28b5094618c82610d1151016fe28746acf8e0ca1 Mon Sep 17 00:00:00 2001 From: Fritz Date: Wed, 27 May 2026 18:04:18 +1000 Subject: [PATCH] feat: reorder version scheme to RELEASE.BETA.ALPHA.BUILD with full automation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename MAJOR→RELEASE; reorder digits: RELEASE.BETA.ALPHA.BUILD - Add ALPHA=0 reset to beta bump case - Add main case: RELEASE+1, reset BETA/ALPHA/BUILD to 0 - Remove main from bump exclusion (uat still excluded) - Add Tag release step on main: git tag release/X.0.0.0 - Reset package.json version to 0.0.1 / 0.0.1.0 (no prod release yet) - Update branch-manager.agent.md version table to new scheme --- .github/agents/branch-manager.agent.md | 30 ++++++++++---------- .github/workflows/ci.yml | 38 ++++++++++++++++++-------- package.json | 4 +-- 3 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.github/agents/branch-manager.agent.md b/.github/agents/branch-manager.agent.md index 4e3ac98..eb08d22 100644 --- a/.github/agents/branch-manager.agent.md +++ b/.github/agents/branch-manager.agent.md @@ -29,25 +29,25 @@ hotfix/* ─────────────────────── **Releases are git tags** (`release/x.y.z`), not branches. They are created automatically by CI when code merges into `main`. Never create a `release/` branch manually. -### Version Format: `MAJOR.ALPHA.BETA.BUILD` +### Version Format: `RELEASE.BETA.ALPHA.BUILD` -| Digit | Bumped by | Example | -|-------|-----------|---------| -| MAJOR | Manual | `2.0.0.0` | -| ALPHA | Merge to `alpha` | `1.3.0.0` | -| BETA | Merge to `beta` | `1.3.2.0` | -| BUILD | Merge to `develop` | `1.3.2.47` | +| Digit | Bumped by | Resets | Example | +|-------|-----------|--------|---------| +| RELEASE | Merge to `main` (automated) | BETA=0, ALPHA=0, BUILD=0 | `1.0.0.0` | +| BETA | Merge to `beta` | ALPHA=0, BUILD=0 | `0.1.0.0` | +| ALPHA | Merge to `alpha` | BUILD=0 | `0.0.2.0` | +| BUILD | Merge to `develop` | — | `0.0.1.47` | ### CI/CD per Branch -| Branch | Tests | Docker Image Tag | Version Bump | -|--------|-------|-----------------|--------------| -| `feature/*` | Unit tests | — | — | -| `develop` | Unit + e2e | `dev-{build}` | BUILD digit | -| `alpha` | All tests | `alpha-1.x.0.0` | ALPHA digit | -| `beta` | All + perf/load | `beta-1.0.x.0` | BETA digit | -| `uat` | Smoke tests (vs anonymised prod data) | Same as prod image | — | -| `main` | — | `1.2.3.4` (prod) | Creates `release/x.y.z` tag | +| Branch | Tests | Version Bump | +|--------|-------|--------------| +| `feature/*` | Unit tests | — | +| `develop` | Unit + build | BUILD digit | +| `alpha` | Unit + build | ALPHA digit, BUILD→0 | +| `beta` | Unit + build | BETA digit, ALPHA→0, BUILD→0 | +| `uat` | Smoke tests | none | +| `main` | Unit + build | RELEASE digit, all others→0; tags `release/X.0.0.0` | ### Naming Rules diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11cbcd0..da13982 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,20 +45,21 @@ jobs: node-version: '24' cache: 'npm' - # ── Version bump (push events only, not PRs, not main/uat) ──────────────── - # Display version format: MAJOR.ALPHA.BETA.BUILD (stored in build.extraMetadata.version) - # Semver format: MAJOR.ALPHA.BETA (stored in version — required by electron-builder) + # ── Version bump (push events only, not PRs, not uat) ───────────────────── + # Display version format: RELEASE.BETA.ALPHA.BUILD (stored in build.extraMetadata.version) + # Semver format: RELEASE.BETA.ALPHA (stored in version — required by electron-builder) # - # develop → increment BUILD (4th digit of extraMetadata.version only) - # alpha → increment ALPHA (2nd digit), reset BUILD to 0, sync 3-part version - # beta → increment BETA (3rd digit), reset BUILD to 0, sync 3-part version + # develop → increment BUILD (4th digit only) + # alpha → increment ALPHA (3rd digit), reset BUILD to 0 + # beta → increment BETA (2nd digit), reset ALPHA and BUILD to 0 + # main → increment RELEASE (1st digit), reset BETA/ALPHA/BUILD to 0, tag release/X.0.0.0 - name: Bump version id: bump - if: github.event_name == 'push' && github.ref_name != 'main' && github.ref_name != 'uat' + if: github.event_name == 'push' && github.ref_name != 'uat' run: | # Read the 4-part display version from extraMetadata EXT_VERSION=$(node -p "require('./package.json').build.extraMetadata.version") - IFS='.' read -r MAJOR ALPHA BETA BUILD <<< "$EXT_VERSION" + IFS='.' read -r RELEASE BETA ALPHA BUILD <<< "$EXT_VERSION" case "${{ github.ref_name }}" in develop) @@ -70,13 +71,20 @@ jobs: ;; beta) BETA=$((BETA + 1)) + ALPHA=0 + BUILD=0 + ;; + main) + RELEASE=$((RELEASE + 1)) + BETA=0 + ALPHA=0 BUILD=0 ;; esac - NEW_EXT_VERSION="${MAJOR}.${ALPHA}.${BETA}.${BUILD}" + NEW_EXT_VERSION="${RELEASE}.${BETA}.${ALPHA}.${BUILD}" # 3-part semver for electron-builder (strips the BUILD digit) - NEW_VERSION="${MAJOR}.${ALPHA}.${BETA}" + NEW_VERSION="${RELEASE}.${BETA}.${ALPHA}" node -e " const fs = require('fs'); @@ -97,7 +105,7 @@ jobs: # Push the version bump commit AFTER tests pass so a failed test doesn't # advance the version counter. - name: Commit and push version bump - if: github.event_name == 'push' && github.ref_name != 'main' && github.ref_name != 'uat' && steps.bump.outputs.new-version != '' + if: github.event_name == 'push' && github.ref_name != 'uat' && steps.bump.outputs.new-version != '' run: | NEW_VERSION="${{ steps.bump.outputs.new-version }}" git config user.name "github-actions[bot]" @@ -107,6 +115,14 @@ jobs: git diff --cached --quiet || git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]" git push + # On main: create a release tag after the version bump commit is pushed. + - name: Tag release + if: github.event_name == 'push' && github.ref_name == 'main' && steps.bump.outputs.new-version != '' + run: | + TAG="release/${{ steps.bump.outputs.new-version }}" + git tag "$TAG" + git push origin "$TAG" + # ─── Job 2: Build the .deb installer (only runs when all tests pass) ────────── build: name: Build Linux DEB diff --git a/package.json b/package.json index a83bfbd..2ad6d26 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "email": "fritz.blignaut@gmail.com" }, "private": true, - "version": "1.0.0", + "version": "0.0.1", "type": "module", "main": "electron/main.cjs", "scripts": { @@ -26,7 +26,7 @@ "appId": "com.techstack.streamdeck", "productName": "Tech Stack Stream Deck", "extraMetadata": { - "version": "1.0.0.3" + "version": "0.0.1.0" }, "directories": { "output": "dist-electron"