This document defines the maintainer release flow for DeepChat without rewriting existing dev / main history.
- Keep
devas the only long-lived integration branch. - Keep
mainas a stable mirror of reviewed release commits. - Keep releases tag-driven through
.github/workflows/release.yml. - Avoid creating new merge commits on
main.
dev: active development and integration branch.main: stable mirror of released source snapshots.release/<version>: short-lived review branch cut from an existing commit ondev.
release/<version> must not carry release-only commits. If a release fix is required, land it on dev first and then move the release branch forward to the updated dev commit.
-
Prepare release metadata on
dev.- Update the version,
CHANGELOG.md, and any release notes ondev. - Run the required local checks before cutting a release branch.
- Update the version,
-
Cut the review branch from the release-ready commit on
dev.git switch dev git pull --ff-only origin dev git switch -c release/v1.0.0-beta.4 git push -u origin release/v1.0.0-beta.4
-
Open a PR from
release/<version>tomain.- The PR exists for review and CI only.
- Do not use the GitHub merge button to land the PR.
- Do not click "Update branch" on the PR, because it creates new merge commits.
-
If review finds a release issue, fix it on
devfirst.git switch dev git pull --ff-only origin dev # land the release fix on dev git branch -f release/v1.0.0-beta.4 origin/dev git switch release/v1.0.0-beta.4 git push --force-with-lease origin release/v1.0.0-beta.4Use
--force-with-leaseonly because the release branch is a disposable review branch that must stay identical to a commit already ondev. -
After the PR is approved, fast-forward
mainlocally on macOS or Linux.pnpm run release:ff -- release/v1.0.0-beta.4 --tag v1.0.0-beta.4
The helper script validates:
- the working tree is clean
- the target release commit already exists on
origin/dev origin/mainis an ancestor of the target commitmaincan be updated withgit merge --ff-only
Windows maintainers should skip this helper and use the manual release sequence below.
-
Create and push the release tag on the same commit.
git tag v1.0.0-beta.4 release/v1.0.0-beta.4 git push origin v1.0.0-beta.4
-
Delete the temporary release branch after the release is published.
git push origin --delete release/v1.0.0-beta.4 git branch -d release/v1.0.0-beta.4
Use this sequence when the automatic helper is unavailable, especially on Windows. It updates origin/main directly from the reviewed release commit and does not depend on the state of your local main.
-
Fetch the latest release refs.
git fetch origin main dev --prune
-
Resolve the reviewed release commit and record it as
TARGET_SHA.git rev-parse origin/release/v1.0.0-beta.4^{commit} # or git rev-parse release/v1.0.0-beta.4^{commit} # or git rev-parse <target-ref>^{commit} -
Confirm the release commit already exists on
origin/dev.git merge-base --is-ancestor <TARGET_SHA> origin/dev
-
Confirm
origin/maincan be fast-forwarded to the reviewed release commit.git merge-base --is-ancestor origin/main <TARGET_SHA>
-
Confirm the release tag does not already exist locally or on
origin.git rev-parse --verify --quiet refs/tags/v1.0.0-beta.4 git ls-remote --exit-code --tags origin refs/tags/v1.0.0-beta.4
Both commands should report that the tag is missing before you continue.
-
Fast-forward
origin/maindirectly to the reviewed release commit.git push origin <TARGET_SHA>:refs/heads/main
-
Create and push the release tag on the same commit.
git tag v1.0.0-beta.4 <TARGET_SHA> git push origin refs/tags/v1.0.0-beta.4
-
Delete the temporary release branch after the release is published.
git push origin --delete release/v1.0.0-beta.4 git branch -d release/v1.0.0-beta.4
These settings are not stored in the repository and must be configured manually on GitHub:
- Enable Require linear history on
main. - Keep PR checks required for PRs targeting
mainanddev. - Allow maintainers to push
mainonly through the documentedff-onlyprocedure. - Treat the PR merge button for
mainas disabled by policy, even if the repository UI still shows it.
- PRs targeting
mainmust come fromrelease/<version>branches. - The head commit of a PR targeting
mainmust already be contained inorigin/dev. - Release tags must point to commits that are already reachable from
origin/main.
These rules are enforced in the repository workflows so the documented flow and the automation stay aligned.
Use first-parent history for day-to-day inspection:
git log --oneline --decorate --first-parent dev -n 30
git log --oneline --decorate --first-parent main -n 30Avoid using git log --all --decorate --graph as the default project view because old release merges and stale branch refs make it noisier than the actual mainline history.
Clean up short-lived branches after they are merged:
git fetch --prune origin
git branch --merged dev