Skip to content

Latest commit

 

History

History
102 lines (76 loc) · 4.56 KB

release.md

File metadata and controls

102 lines (76 loc) · 4.56 KB

Release process

  • develop is the only long-lived branch.
  • Staging and production both run tagged releases (vX.Y.Z). A tag goes to staging first, then to production.
  • A hotfix is a branch created from the production tag, released as a patch version.

What gets published

Every push to develop and every v*.*.* tag runs .github/workflows/helm-publish.yaml (tests run first; nothing is published if they fail).

Trigger Docker image Helm chart (oci://ghcr.io/ifrcgo) GitHub Release
push develop ghcr.io/ifrcgo/go-api:develop.c<sha7> ifrcgo-helm:<X.Y.Z>-develop.c<sha7> no
push tag vX.Y.Z ghcr.io/ifrcgo/go-api:vX.Y.Z.c<sha7> ifrcgo-helm:X.Y.Z-<sha7> yes (vX.Y.Z)

The chart version comes from deploy/helm/Chart.yaml, which release.sh bumps. The exact chart version to deploy is shown at the top of each GitHub Release.

Note

Branches containing a / (e.g. project/*) publish to a separate chart (ifrcgo-dev-helm) and image (go-api-dev). Don't deploy these to staging or production.

Commit messages

The changelog is generated by git-cliff from commit messages, so they must follow Conventional Commits (feat:, fix:, chore:, docs:, refactor:, ...).

Important

Commits without a Conventional Commit prefix are left out of the changelog.

Changes before the generated changelog (releases up to 1.1.509 and its "Unreleased" section) are kept in CHANGELOG-legacy.md. START_COMMIT in release.sh is the last commit it covers.

Prerequisites (release manager)

  • typos, git-cliff
  • semver on your PATH, since release.sh calls it directly:
    # Install
    npm install -g semver
    
    # Check: prints 1.3.0 for a valid version
    npx semver v1.3.0
  • gh, logged in (gh auth login)
  • GPG-signed tags (git config tag.gpgSign true), since release.sh verifies the tag
  • Run from a normal clone (not a git worktree) with the fugit submodule checked out: git submodule update --init fugit

Normal release

git checkout develop && git pull
./release.sh              # enter the new version, e.g. v1.3.0
git push origin v1.3.0    # CI publishes image, chart and GitHub Release
git push origin develop   # push the "chore(release): prepare for v1.3.0" commit

Then deploy:

  1. Copy the chart version from the GitHub Release (e.g. 1.3.0-abc1234).
  2. Staging: open a PR in go-deploy updating targetRevision in applications/argocd/staging/applications/go-api.yaml. Merge after review. ArgoCD syncs staging.
  3. Check the release on staging.
  4. Production: open a second go-deploy PR with the same chart version in applications/argocd/production/applications/go-api.yaml. Merge after review. ArgoCD syncs production.

See go-deploy.md for ArgoCD access and sync details.

Hotfix

Use when production needs a fix but develop contains unreleased work.

git fetch --tags
git checkout -b hotfix/<short-name> v1.3.0    # the tag production is running
# fix, then commit: "fix: ..."
git push origin hotfix/<short-name>
  1. Open a PR hotfix/<short-name> → develop and get it reviewed. The diff only contains the hotfix commits.
  2. After approval, on the hotfix branch:
    ./release.sh                                 # bump patch version, e.g. v1.3.1 (confirm the "not on develop" prompt)
    git push origin v1.3.1 hotfix/<short-name>
  3. Deploy the chart version from the v1.3.1 GitHub Release to staging, then production, via go-deploy PRs.
  4. Merge the hotfix PR into develop (resolve CHANGELOG.md / version conflicts by keeping develop's version lines).

Use a -devN suffix (e.g. v1.3.1-dev0) to publish a pre-release that can be tried on staging first.

Rollback

Revert the go-deploy commit for that environment to go back to the previous chart version.

Warning

Rollback does not reverse database migrations. Keep migrations backward compatible (add first, remove in a later release). If a migration must be reversed, run ./manage.py migrate <app> <previous_migration> before rolling back the chart.