|
1 | 1 | # Repository maintenance and release |
2 | 2 |
|
3 | 3 | ## How to release |
4 | | -* manually run [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow |
5 | | -* after the previous workflow finishes, dispatch the GitHub workflow [Netlify Deploy](.github/workflows/netlify-deploy.yaml) on the `master` branch (takes ~15 minutes) |
6 | | - * The styling of the documentation is taken from the `master` branch. For more details see [generate.sh](scripts/generate.sh). |
7 | | -* after the previous workflow finishes, push tag |
8 | | - * the version should be the same as the one in [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow log |
9 | | - * checkout latest master branch and tag it `vX.Y.Z` |
10 | | - * push the tag to the gooddata/gooddata-python-sdk repository (e.g. `git push <remote> vX.Y.Z`) |
| 4 | +Manually run the [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow and pick the |
| 5 | +bump type. That is the whole release. |
11 | 6 |
|
| 7 | +The workflow bumps the version, creates the `rel/X.Y.Z` branch, merges it to `master`, and pushes the tag |
| 8 | +`vX.Y.Z`. That tag push triggers two workflows in parallel: |
| 9 | + |
| 10 | +* [Build Python Package and Create Release](.github/workflows/build-release.yaml) — builds every component, |
| 11 | + creates the GitHub release, publishes to PyPI, and posts to `#releases`. |
| 12 | +* [Netlify Deploy](.github/workflows/netlify-deploy.yaml) — builds and publishes the documentation |
| 13 | + (takes ~15 minutes, so the packages reach PyPI well before the docs go live). |
| 14 | + |
| 15 | +The styling of the documentation is taken from the `master` branch. For more details see |
| 16 | +[generate.sh](scripts/generate.sh). |
| 17 | + |
| 18 | +### Recovering a stuck release |
| 19 | +Both downstream workflows key off the tag, so a release that stalled can be resumed by hand: |
| 20 | + |
| 21 | +* if the tag was never pushed, check out the `Release X.Y.Z` commit on `master`, tag it `vX.Y.Z`, and push the |
| 22 | + tag to the gooddata/gooddata-python-sdk repository (e.g. `git push <remote> vX.Y.Z`) |
| 23 | +* if only the documentation failed, dispatch [Netlify Deploy](.github/workflows/netlify-deploy.yaml) manually; |
| 24 | + it does not need the tag |
| 25 | + |
| 26 | +The tag has to be pushed with a personal access token. GitHub does not trigger workflows from pushes made with |
| 27 | +the default `GITHUB_TOKEN`, so a tag pushed by a workflow using it would silently start nothing. |
| 28 | + |
| 29 | +## How to patch an already released version |
| 30 | +Use this whenever a release must contain a specific fix and *not* everything currently on `master` — whether |
| 31 | +that is an old line (1.60 while `master` is at 1.73) or the newest one. |
| 32 | + |
| 33 | +Do **not** use the [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow for this. Its |
| 34 | +last step is `git checkout master && git merge`, which would drag the old code and version numbers onto |
| 35 | +`master`. Its `patch` bump type means "release master as a patch", not "patch the released line". |
| 36 | + |
| 37 | +Only the tagging is automated; the rest is manual by nature. |
| 38 | + |
| 39 | +**Prerequisite:** the fix is already merged to `master`. The patch branch is never merged back, so this is what |
| 40 | +keeps the fix from being lost in the next release. |
| 41 | + |
| 42 | +1. **Pick the base and the new version.** List what the line already has with |
| 43 | + `git branch -rl '<remote>/rel/1.60.*'`. The base is the newest of them — `rel/1.60.0`, or `rel/1.60.2` if the |
| 44 | + line was patched before. The new version increments the patch component: `1.60.1`. |
| 45 | + |
| 46 | +2. **Create the release branch first**, so the fix has somewhere to be reviewed into: |
| 47 | + ```bash |
| 48 | + git fetch <remote> |
| 49 | + git checkout -b rel/1.60.1 <remote>/rel/1.60.0 |
| 50 | + git push <remote> rel/1.60.1 |
| 51 | + ``` |
| 52 | + |
| 53 | +3. **Cherry-pick the fix through a pull request:** |
| 54 | + ```bash |
| 55 | + git checkout -b fix/backport-1.60 rel/1.60.1 |
| 56 | + git cherry-pick <sha-on-master> |
| 57 | + git push <remote> fix/backport-1.60 |
| 58 | + ``` |
| 59 | + Open the PR against `rel/1.60.1`. The [pre-merge pipeline](.github/workflows/pre-merge.yaml) runs because it |
| 60 | + triggers on `rel/**`. Merge once it is green. |
| 61 | + |
| 62 | +4. **Bump the version on the release branch** — the same steps the bump workflow performs: |
| 63 | + ```bash |
| 64 | + git checkout rel/1.60.1 && git pull |
| 65 | + uv sync --only-group release --locked |
| 66 | + uv run python ./scripts/bump_doc_dependencies.py 1.60.1 |
| 67 | + make release-ci VERSION=1.60.1 |
| 68 | + git commit -am "Release 1.60.1" |
| 69 | + git push <remote> rel/1.60.1 |
| 70 | + ``` |
| 71 | + |
| 72 | +5. **Tag it.** This is the only trigger; everything after it is automatic: |
| 73 | + ```bash |
| 74 | + git tag v1.60.1 |
| 75 | + git push <remote> v1.60.1 |
| 76 | + ``` |
| 77 | + |
| 78 | +The release is then built and published exactly like any other, with two differences handled automatically by |
| 79 | +[is-latest-release](.github/actions/is-latest-release/action.yaml): the GitHub release does not take the |
| 80 | +"Latest" badge from the newest version, and the documentation is not rebuilt — a docs build from an old tag |
| 81 | +would deploy that tag's content over the current site. |
| 82 | + |
| 83 | +### What the documentation will show |
| 84 | +The docs site keeps the four newest release branches, sorted by `major.minor`, and a section is named after the |
| 85 | +`major.minor` only. Consequences worth knowing before someone goes looking: |
| 86 | + |
| 87 | +* Patching a recent line replaces it: `rel/1.72.1` takes over the `1.72` section from `rel/1.72.0`. |
| 88 | +* Both branches still occupy a slot of the four, so one patch inside the window drops the site from four |
| 89 | + displayed versions to three. |
| 90 | +* Patching an old line (`rel/1.60.1` while `master` is at 1.73) falls outside the window entirely and never |
| 91 | + appears in the docs. |
12 | 92 |
|
13 | 93 | ### How-to dev release |
14 | 94 | To publish current master as a dev release version, use [Dev release from master](.github/workflows/dev-release.yaml) GitHub workflow. |
|
0 commit comments