Publish My Branch - Cheatsheet
Requires:
- GITHUB Auto Merge is ON, for Repo
Assumes:
- the User / Developer made all their changes on a
User Brbranch - there is a dedicated
masterbranch, for tagged production commits (public API) - Protection Rules, with suitable Required Checks for branches
masterrelease-traintest-distrotest-docstest-distro-docs
START
Running on Linux shell.
function git-tag { git tag -f "$1" && git push origin -f "$1"; }
function parse-version { grep -E -o '^version\s*=\s*\".*\"' pyproject.toml | cut -d'"' -f2; }
Push board-n-release git tag, from your User Br Branch:
git push
git-tag board-n-release
Wait for PR opened 'release' --> 'master' - https://github.com/boromir674/cookiecutter-python-package/pulls?q=is%3Apr+is%3Aopen+base%3Amaster
git fetch && (git checkout release || git branch --track release origin/release) && git pull origin release
Sem Ver + Changelog updates on release branch
-
[OPT1]: For Public API Releases
./scripts/auto-release.sh -
[OPT2]: For Internal Releases
- Do Sem Ver source updates and commits (1 or more files)
- Do Changelog update and commit (1 file)
- Run
git push origin release git-tag auto-prod
-
Code Review PR on Github
Find open PRs to
masterbranch:
Expect PR Merge to master, after all Required Checks Pass!
Git Tag is automatically pushed after that!
Simply Wait until that happens!
Now, make a new Release:
git checkout master && git pull && git push
export tt="v$(parse-version)"
gh release create "$tt"
Clean Origin Git with:
# Delete Git Ops TAGS
git push origin -d board-request
git push origin -d auto-prod
# Delete Git Ops BRANCHES
git push origin -d boarding-auto
git push origin -d test-docs
git push origin -d test-distro
git push origin -d test-distro-docs
git push origin -d direct-onboarding
git push origin -d release-train
git push origin -d release
Clean Local with:
git tag -d board-request
git tag -d auto-prod