|
| 1 | +# Releasing |
| 2 | + |
| 3 | +Git Smart Checkout publishes to the VS Code Marketplace and Open VSX through two |
| 4 | +GitHub Actions workflows, both driven by `semantic-release` (`release.config.js`) |
| 5 | +and both manual (`workflow_dispatch`) — nothing publishes automatically on push. |
| 6 | + |
| 7 | +## Two channels, one branch |
| 8 | + |
| 9 | +There is no separate `next`/`beta` branch. Both channels release from `main`; |
| 10 | +"pre-release" means *merged to `main` but not yet blessed as stable*, not a |
| 11 | +separate line of code. |
| 12 | + |
| 13 | +| | Stable | Pre-release | |
| 14 | +|---|---|---| |
| 15 | +| Workflow | **Release** (`.github/workflows/release.yml`) | **Pre-release** (`.github/workflows/pre-release.yml`) | |
| 16 | +| Version | `major.EVEN.patch` | `major.ODD.patch` | |
| 17 | +| Packaging | `vsce package` | `vsce package --pre-release` | |
| 18 | +| GitHub release | Latest | marked **Pre-release**, not Latest | |
| 19 | + |
| 20 | +Both lanes share one strictly increasing version sequence and one `v${version}` |
| 21 | +git tag line, so a stable release can never collide with or undercut an |
| 22 | +already-published pre-release. |
| 23 | + |
| 24 | +## Odd/even minor convention |
| 25 | + |
| 26 | +Following [Microsoft's documented convention](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#prerelease-extensions): |
| 27 | +stable releases use an **even** minor, pre-releases use an **odd** minor. The |
| 28 | +bump is mechanical: |
| 29 | + |
| 30 | +- **Pre-release run:** last release had an even minor (or none exists yet) → |
| 31 | + bump minor; last minor was already odd → bump patch. |
| 32 | +- **Stable run:** last release had an odd minor → force a minor bump (jump |
| 33 | + over the pre-release corridor); otherwise defer to conventional commits as |
| 34 | + usual. |
| 35 | + |
| 36 | +``` |
| 37 | +stable 0.16.1 |
| 38 | +pre 0.17.0 first pre-release of the cycle (minor bump) |
| 39 | +pre 0.17.1 further pre-releases stay on the odd minor (patch bumps) |
| 40 | +pre 0.17.2 |
| 41 | +stable 0.18.0 cut stable (minor bump, jumps over 0.17.x) |
| 42 | +pre 0.19.0 next pre-release cycle opens |
| 43 | +``` |
| 44 | + |
| 45 | +The bump logic lives in `scripts/nextReleaseType.mjs`, wired into |
| 46 | +`release.config.js` as the `analyzeCommitsCmd` for `@semantic-release/exec`. |
| 47 | + |
| 48 | +**Operational rule:** ship stable patches before opening the next pre-release |
| 49 | +cycle. Once a pre-release minor (e.g. `0.19.0`) is published, the next stable |
| 50 | +release — hotfix or not — jumps to `0.20.0` and carries everything merged to |
| 51 | +`main` since the last stable. This is the cost of the single-branch model. |
| 52 | + |
| 53 | +## Running a release |
| 54 | + |
| 55 | +- **Release** — dispatch from the Actions tab on `main`. Runs `semantic-release` |
| 56 | + with `RELEASE_CHANNEL=stable`. |
| 57 | +- **Pre-release** — dispatch from the Actions tab on `main`. Runs |
| 58 | + `semantic-release` with `RELEASE_CHANNEL=pre`. Skips publishing (with a log |
| 59 | + message) if there are no commits since the last tag, unless the `force` |
| 60 | + input is set. |
| 61 | + |
| 62 | +Neither workflow requires manual version bumping — `semantic-release` computes |
| 63 | +the next version, updates `package.json`/`CHANGELOG.md`, tags, packages the |
| 64 | +VSIX, and publishes to both registries in one run. |
| 65 | + |
| 66 | +## Opting in to pre-releases |
| 67 | + |
| 68 | +End users switch channels from the VS Code Extensions view: open the Git Smart |
| 69 | +Checkout entry and choose **Switch to Pre-Release Version**. VS Code always |
| 70 | +installs the highest version available on the user's channel, so a pre-release |
| 71 | +user is still offered later stable releases. |
0 commit comments