Skip to content

Publish My Branch - Cheatsheet

Requires:

  • GITHUB Auto Merge is ON, for Repo

Assumes:

  • the User / Developer made all their changes on a User Br branch
  • there is a dedicated master branch, for tagged production commits (public API)
  • Protection Rules, with suitable Required Checks for branches
  • master
  • release-train
  • test-distro
  • test-docs
  • test-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

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"
--> !! DONE !! <--

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