|
| 1 | +# Versioning |
| 2 | + |
| 3 | +This SDK is configured with the `manual` versioning policy. |
| 4 | + |
| 5 | +- `manual`: package versions are set explicitly before release. |
| 6 | +- `semver`: releases should follow semantic versioning based on API and SDK surface changes. |
| 7 | +- `calendar`: releases should use a calendar-derived version chosen by the release workflow or maintainer. |
| 8 | + |
| 9 | +## Branches and releases |
| 10 | + |
| 11 | +This repository follows a three-branch flow, managed by the Scalar platform together |
| 12 | +with the generated workflows (which need only the default `GITHUB_TOKEN` — no extra |
| 13 | +token required): |
| 14 | + |
| 15 | +- **`scalar-generated`** — pristine generator output. Pushed by the Scalar platform; do |
| 16 | + not commit here. |
| 17 | +- **`scalar-next`** — generated output merged with this repository's custom code. Commit |
| 18 | + your customizations here (directly or via PRs). The Scalar platform merges each |
| 19 | + regeneration into this branch and keeps the release PR up to date; merge conflicts |
| 20 | + arrive as a PR from `scalar-merge-conflict` for you to resolve. |
| 21 | +- **Default branch** — seeded from the first generated snapshot, then only ever receives |
| 22 | + released states, each one the merge of a release PR. |
| 23 | + |
| 24 | +Release PRs are opened by the Scalar platform from `scalar-next` against the default |
| 25 | +branch — so the PR diff shows the full pending release — and are versioned from |
| 26 | +[Conventional Commits](https://www.conventionalcommits.org). Merging a release PR tags the |
| 27 | +release, publishes it, and syncs the version bump and changelog back to `scalar-next`. |
| 28 | +Pre-1.0, breaking changes bump the minor version; to cut `1.0.0` (or any explicit |
| 29 | +version), push an empty commit with a `Release-As` footer to `scalar-next`: |
| 30 | + |
| 31 | +```sh |
| 32 | +git commit --allow-empty -m "chore: release 1.0.0" -m "Release-As: 1.0.0" |
| 33 | +``` |
| 34 | + |
| 35 | +### When a release PR does not merge cleanly |
| 36 | + |
| 37 | +Nothing is ever force-pushed automatically: a release PR that conflicts with the default |
| 38 | +branch simply cannot be merged, and GitHub disables its merge button. The two causes have |
| 39 | +different fixes: |
| 40 | + |
| 41 | +- **The default branch received direct commits** (for example a hotfix) that are not in |
| 42 | + `scalar-next`. Land those commits on `scalar-next` (merge the default branch into it, or |
| 43 | + cherry-pick), and the refreshed release PR merges cleanly again. Do not force-push — |
| 44 | + that would discard the direct commits. |
| 45 | +- **The repository was adopted with pre-existing content**, so the default branch shares |
| 46 | + no history with `scalar-next`. The Scalar platform adds a checkbox to the release PR |
| 47 | + description offering to replace the default branch with this release; checking it |
| 48 | + authorizes the platform to force-push the released state over the old content. This is |
| 49 | + destructive for anything on the default branch that never reached `scalar-next`, which |
| 50 | + is why it requires that explicit opt-in. |
| 51 | + |
| 52 | +### Repository prerequisites |
| 53 | + |
| 54 | +- Branch protection on `scalar-next` and the default branch must allow the Scalar |
| 55 | + platform and the `github-actions` bot to push (or be left unprotected); the default |
| 56 | + branch only ever advances by merging release PRs, and `scalar-next` receives each |
| 57 | + released state back from the release workflow. |
| 58 | +- No Actions settings changes are required: the generated workflows declare their own |
| 59 | + permissions and never create pull requests. |
0 commit comments