Branching Strategy¶
This project uses a release-branch flow designed to keep main always reflecting the latest release while allowing continuous development on dev.
Branch Roles¶
| Branch | Purpose | Merges from | Merges to |
|---|---|---|---|
main |
Latest release only | release/* via PR |
Synced back to dev |
dev |
Next release accumulator | feature/*, fix/* via PR |
Cut release/* branches |
feature/*, fix/* |
Individual work items | Branched from dev |
PR to dev |
release/vX.Y.Z |
Release stabilization | Cut from dev |
PR to main |
Flow Diagram¶
gitGraph
commit id: "v0.2.0"
branch dev
commit id: "feat: A"
commit id: "feat: B"
commit id: "fix: C"
branch release/v0.3.0
commit id: "chore: bump version"
checkout main
merge release/v0.3.0 id: "Release v0.3.0"
checkout dev
merge main id: "sync"
commit id: "feat: D"
Rules¶
- Never push directly to
mainordev-- all changes arrive via pull requests. - Flow is one-directional:
feature->dev->release->main-> (sync back todev). - After every release merge,
mainis automatically synced back todevvia thesync-dev.ymlworkflow. This prevents merge conflicts. - Release branches are short-lived -- days, not weeks. Cut them when
devis ready, stabilize quickly, merge tomain.
Development Workflow¶
Working on a Feature or Fix¶
# Start from dev
git checkout dev
git pull origin dev
# Create your branch
git checkout -b feature/add-texture-filtering
# ... develop, commit ...
# Push and open a PR targeting dev
git push -u origin feature/add-texture-filtering
Open a PR from feature/add-texture-filtering to dev. The PR test matrix and clang-format will run automatically.
Cutting a Release¶
When dev has accumulated enough changes for a release:
# Start from dev
git checkout dev
git pull origin dev
# Create the release branch (must follow vX.Y.Z naming)
git checkout -b release/v0.3.0
On the release branch:
- Bump the version in
CMakeLists.txt(theproject(... VERSION X.Y.Z ...)line). - Apply only bugfixes if issues are found during testing.
- Push and open a PR targeting
main.
What Happens on Merge¶
When the release PR is merged to main, three things happen automatically:
auto-tag.ymlcreates a git tagvX.Y.Zfrom the release branch name.release.ymltriggers on the new tag, builds Linux and Windows binaries, and creates a GitHub Release with artifacts and changelog.sync-dev.ymlmergesmainback intodevto keep them aligned. If there are conflicts (rare), it creates a PR for manual resolution instead.
Version Naming¶
- Tags follow the format
vX.Y.Z(e.g.,v0.3.0) - Pre-release suffixes are supported:
v0.3.0-alpha,v0.3.0-beta - Tags containing
alphaorbetaare automatically marked as pre-releases on GitHub - The version in
CMakeLists.txtshould match the base version (without thevprefix or pre-release suffix)
CI/CD Workflows¶
| Workflow | Trigger | Purpose |
|---|---|---|
pr-test.yml |
PRs to dev, main, release/** |
Multi-platform test matrix (Linux GCC/Clang, Windows MSVC/Clang) |
clang-format.yaml |
All PRs | Auto-format C/C++ files |
auto-tag.yml |
Release PR merged to main |
Creates git tag from release branch name |
release.yml |
Tag push (v*) |
Builds artifacts and creates GitHub Release |
sync-dev.yml |
Push to main |
Merges main back into dev |
docs.yml |
Push to main (docs paths) |
Deploys documentation site |