This project uses a gitflow-style release process. Development is integrated on
develop; releases are made from main and triggered by tags named
vMAJOR.MINOR.PATCH.
- Push access to
lloydsmart/chdtool - Permission to merge into
developandmain - GitHub Actions permission to create pull requests
- Bash, Make, ShellCheck,
tar,gzip,zip,unzip, andsha256sum git-cliffwhen generating changelogs locally
Start with a clean, current checkout:
git switch develop
git pull --ff-only origin develop
git status --shortThe final command should print nothing.
Choose the next version according to Semantic Versioning. Create a release
branch from develop. Keep the v in the branch name when using git-flow:
git switch -c release/v0.2.5Update CHDTOOL_VERSION near the top of chdtool.sh. Confirm that the CLI
reports the intended value:
./chdtool.sh --versionThe release workflow rejects a tag whose version does not match this value.
Run the same functional and shell checks used by the release workflow:
make test
shellcheck chdtool.sh scripts/*.sh tests/*.sh tests/bin/*When actionlint and markdownlint-cli2 are available, also run:
actionlint
npx --yes markdownlint-cli2 "**/*.md" "#CHANGELOG.md" \
"#CHANGELOG_RELEASE.md" "#LICENSE"Build and validate the release assets locally:
make package VERSION=0.2.5
(cd dist && sha256sum --check SHA256SUMS)
tar -tzf dist/chdtool-v0.2.5.tar.gz
unzip -Z1 dist/chdtool-v0.2.5.zipBoth archives must contain exactly one top-level chdtool-v0.2.5 directory
with these files:
chdtoolREADME.mdLICENSECHANGELOG.md
The dist/ directory is rebuilt from scratch by the packaging command.
Commit the version change, push the release branch, and open a pull request
directly into main:
git add chdtool.sh
git commit -m "chore: prepare v0.2.5"
git push -u origin release/v0.2.5The pull request represents the complete promotion of the release candidate
from develop to main. Merge only after all required checks pass. Do not tag
the release branch or an unmerged commit.
Update local main and verify the version one final time:
git switch main
git pull --ff-only origin main
./chdtool.sh --version
git status --shortCreate an annotated tag on that exact commit and push only the tag:
git tag -a v0.2.5 -m "Release v0.2.5"
git push origin v0.2.5Pushing the tag starts the Release workflow. It:
- runs the complete test suite and ShellCheck;
- generates release notes with git-cliff;
- builds reproducible
.tar.gzand.ziparchives; - validates their exact contents;
- creates
SHA256SUMSand verifies every checksum; - publishes the GitHub release and assets; and
- opens a pull request to update
CHANGELOG.mdonmain.
On the GitHub release page, confirm:
- the release is attached to the intended tag and commit;
- the release notes are present;
chdtool, both archives, andSHA256SUMSare attached; and- downloaded assets pass
sha256sum --check SHA256SUMS.
Merge the automated changelog pull request after its checks pass. Finally, open
a backport pull request from main into develop so both long-lived branches
contain the release merge, tag history, and generated changelog. Resolve the
backport before starting further release work.
Both main and develop must have GitHub branch protection enabled, with branch
deletion and force pushes disabled. This prevents GitHub's automatic head-branch
deletion from removing main after the backport pull request is merged.
- If preflight checks or local packaging fail, fix them on the release branch; do not tag.
- If the tag workflow fails before publishing a release, inspect the failed job, fix the problem through the normal branch and pull-request flow, then decide whether the unused tag can be deleted and recreated.
- Never move or reuse a tag after a GitHub release has been published. Correct a published release with a new patch version.
- Do not upload hand-built replacement assets to an automated release; rerun a corrected workflow under a new version so provenance and checksums remain consistent.