Skip to content

Commit 82e447b

Browse files
Merge pull request #54 from FritzBlignaut/feature/fix-versioning
feat: reorder version scheme to RELEASE.BETA.ALPHA.BUILD with full automation
2 parents 135facd + 28b5094 commit 82e447b

3 files changed

Lines changed: 44 additions & 28 deletions

File tree

.github/agents/branch-manager.agent.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,25 @@ hotfix/* ───────────────────────
2929

3030
**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.
3131

32-
### Version Format: `MAJOR.ALPHA.BETA.BUILD`
32+
### Version Format: `RELEASE.BETA.ALPHA.BUILD`
3333

34-
| Digit | Bumped by | Example |
35-
|-------|-----------|---------|
36-
| MAJOR | Manual | `2.0.0.0` |
37-
| ALPHA | Merge to `alpha` | `1.3.0.0` |
38-
| BETA | Merge to `beta` | `1.3.2.0` |
39-
| BUILD | Merge to `develop` | `1.3.2.47` |
34+
| Digit | Bumped by | Resets | Example |
35+
|-------|-----------|--------|---------|
36+
| RELEASE | Merge to `main` (automated) | BETA=0, ALPHA=0, BUILD=0 | `1.0.0.0` |
37+
| BETA | Merge to `beta` | ALPHA=0, BUILD=0 | `0.1.0.0` |
38+
| ALPHA | Merge to `alpha` | BUILD=0 | `0.0.2.0` |
39+
| BUILD | Merge to `develop` || `0.0.1.47` |
4040

4141
### CI/CD per Branch
4242

43-
| Branch | Tests | Docker Image Tag | Version Bump |
44-
|--------|-------|-----------------|--------------|
45-
| `feature/*` | Unit tests |||
46-
| `develop` | Unit + e2e | `dev-{build}` | BUILD digit |
47-
| `alpha` | All tests | `alpha-1.x.0.0` | ALPHA digit |
48-
| `beta` | All + perf/load | `beta-1.0.x.0` | BETA digit |
49-
| `uat` | Smoke tests (vs anonymised prod data) | Same as prod image | |
50-
| `main` | | `1.2.3.4` (prod) | Creates `release/x.y.z` tag |
43+
| Branch | Tests | Version Bump |
44+
|--------|-------|--------------|
45+
| `feature/*` | Unit tests ||
46+
| `develop` | Unit + build | BUILD digit |
47+
| `alpha` | Unit + build | ALPHA digit, BUILD→0 |
48+
| `beta` | Unit + build | BETA digit, ALPHA→0, BUILD→0 |
49+
| `uat` | Smoke tests | none |
50+
| `main` | Unit + build | RELEASE digit, all others→0; tags `release/X.0.0.0` |
5151

5252
### Naming Rules
5353

.github/workflows/ci.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,21 @@ jobs:
4545
node-version: '24'
4646
cache: 'npm'
4747

48-
# ── Version bump (push events only, not PRs, not main/uat) ────────────────
49-
# Display version format: MAJOR.ALPHA.BETA.BUILD (stored in build.extraMetadata.version)
50-
# Semver format: MAJOR.ALPHA.BETA (stored in version — required by electron-builder)
48+
# ── Version bump (push events only, not PRs, not uat) ─────────────────────
49+
# Display version format: RELEASE.BETA.ALPHA.BUILD (stored in build.extraMetadata.version)
50+
# Semver format: RELEASE.BETA.ALPHA (stored in version — required by electron-builder)
5151
#
52-
# develop → increment BUILD (4th digit of extraMetadata.version only)
53-
# alpha → increment ALPHA (2nd digit), reset BUILD to 0, sync 3-part version
54-
# beta → increment BETA (3rd digit), reset BUILD to 0, sync 3-part version
52+
# develop → increment BUILD (4th digit only)
53+
# alpha → increment ALPHA (3rd digit), reset BUILD to 0
54+
# beta → increment BETA (2nd digit), reset ALPHA and BUILD to 0
55+
# main → increment RELEASE (1st digit), reset BETA/ALPHA/BUILD to 0, tag release/X.0.0.0
5556
- name: Bump version
5657
id: bump
57-
if: github.event_name == 'push' && github.ref_name != 'main' && github.ref_name != 'uat'
58+
if: github.event_name == 'push' && github.ref_name != 'uat'
5859
run: |
5960
# Read the 4-part display version from extraMetadata
6061
EXT_VERSION=$(node -p "require('./package.json').build.extraMetadata.version")
61-
IFS='.' read -r MAJOR ALPHA BETA BUILD <<< "$EXT_VERSION"
62+
IFS='.' read -r RELEASE BETA ALPHA BUILD <<< "$EXT_VERSION"
6263
6364
case "${{ github.ref_name }}" in
6465
develop)
@@ -70,13 +71,20 @@ jobs:
7071
;;
7172
beta)
7273
BETA=$((BETA + 1))
74+
ALPHA=0
75+
BUILD=0
76+
;;
77+
main)
78+
RELEASE=$((RELEASE + 1))
79+
BETA=0
80+
ALPHA=0
7381
BUILD=0
7482
;;
7583
esac
7684
77-
NEW_EXT_VERSION="${MAJOR}.${ALPHA}.${BETA}.${BUILD}"
85+
NEW_EXT_VERSION="${RELEASE}.${BETA}.${ALPHA}.${BUILD}"
7886
# 3-part semver for electron-builder (strips the BUILD digit)
79-
NEW_VERSION="${MAJOR}.${ALPHA}.${BETA}"
87+
NEW_VERSION="${RELEASE}.${BETA}.${ALPHA}"
8088
8189
node -e "
8290
const fs = require('fs');
@@ -97,7 +105,7 @@ jobs:
97105
# Push the version bump commit AFTER tests pass so a failed test doesn't
98106
# advance the version counter.
99107
- name: Commit and push version bump
100-
if: github.event_name == 'push' && github.ref_name != 'main' && github.ref_name != 'uat' && steps.bump.outputs.new-version != ''
108+
if: github.event_name == 'push' && github.ref_name != 'uat' && steps.bump.outputs.new-version != ''
101109
run: |
102110
NEW_VERSION="${{ steps.bump.outputs.new-version }}"
103111
git config user.name "github-actions[bot]"
@@ -107,6 +115,14 @@ jobs:
107115
git diff --cached --quiet || git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
108116
git push
109117
118+
# On main: create a release tag after the version bump commit is pushed.
119+
- name: Tag release
120+
if: github.event_name == 'push' && github.ref_name == 'main' && steps.bump.outputs.new-version != ''
121+
run: |
122+
TAG="release/${{ steps.bump.outputs.new-version }}"
123+
git tag "$TAG"
124+
git push origin "$TAG"
125+
110126
# ─── Job 2: Build the .deb installer (only runs when all tests pass) ──────────
111127
build:
112128
name: Build Linux DEB

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"email": "fritz.blignaut@gmail.com"
66
},
77
"private": true,
8-
"version": "1.0.0",
8+
"version": "0.0.1",
99
"type": "module",
1010
"main": "electron/main.cjs",
1111
"scripts": {
@@ -26,7 +26,7 @@
2626
"appId": "com.techstack.streamdeck",
2727
"productName": "Tech Stack Stream Deck",
2828
"extraMetadata": {
29-
"version": "1.0.0.3"
29+
"version": "0.0.1.0"
3030
},
3131
"directories": {
3232
"output": "dist-electron"

0 commit comments

Comments
 (0)