Skip to content

Commit bb28a74

Browse files
authored
Merge pull request #12964 from CesiumGS/patch-release-guide
Add patch release instructions
2 parents 7923352 + 1b283fd commit bb28a74

File tree

3 files changed

+148
-10
lines changed

3 files changed

+148
-10
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Patch Releases
2+
3+
Occasionally, we need to release versions of CesiumJS prior to our typical [monthly train releases](../README.md). This can arise because of a critical regression or compatibility issue with the published dependency versions. When this is necessary, we publish a **patch** release[^1]. Tools like npm which use Semantic Versioning will usually use this new version of the package the next time a user runs `npm install` without the user needing to opt-in.
4+
5+
[^1]: See ["About semantic versioning" on docs.npmjs.com](https://docs.npmjs.com/about-semantic-versioning)
6+
7+
## Publishing a patch version
8+
9+
This process is based on an abbreviated version of the [monthly release guide](../README.md). Familiarity with our typical release process is recommended, but not required.
10+
11+
### 1. Create a new branch from the base tag
12+
13+
If no additional commits (besides the intended patch fix) have been merged into `main` since the monthly release, you may create a new branch from `main` and skip step 2. Otherwise, proceed with the steps below.
14+
15+
- Checkout a git tag for the base branch– i.e., use `1.123` in place of `<git-tag>` for the previous monthly release, or `1.123.1` for a subsequent patches applied in the same month.
16+
- From this branch, create a new branch with any unique `<branch-name>`.
17+
18+
#### Commands
19+
20+
```sh
21+
git checkout <git-tag>
22+
git checkout -b <branch-name>
23+
```
24+
25+
### 2. Cherry pick relevant commits
26+
27+
- Use [`git-cherry-pick`](https://git-scm.com/docs/git-cherry-pick) one or more times to apply select commits to the current branch
28+
- As necessary, resolve any merge conflicts, add, and continue.
29+
30+
#### Commands
31+
32+
```sh
33+
git cherry-pick <commit-hash>
34+
```
35+
36+
### 3. Bump the release version
37+
38+
Use [npm `version` with the `patch` command](https://docs.npmjs.com/cli/v11/commands/npm-version) to bump the version of each workspace and the root package– e.g., `npm version patch --no-git-tag-version`
39+
40+
#### Commands
41+
42+
```sh
43+
npm version patch --ws --no-git-tag-version
44+
npm version patch --no-git-tag-version
45+
```
46+
47+
### 4. Update `CHANGES.md`
48+
49+
- In [`CHANGES.md`](../../../CHANGES.md), create a new header with the version string of root package from the previous step and the date of the release— e.g., if the version string from the previous step is `1.123.1`, `CHANGES.md` should read:
50+
51+
```md
52+
# Change Log
53+
54+
## 1.123.1 - 2025-07-15
55+
56+
### @cesium/engine
57+
58+
...
59+
```
60+
61+
- Move any relevant items in the list to the new header in `CHANGES.md`.
62+
- Delete any empty headers.
63+
- Ensure each change is nested in the section for the relevant workspace.
64+
- Commit any staged changes and push to your branch.
65+
66+
### 5. Release build and sanity test
67+
68+
While the full extent of typical release testing is not required, at minimum, create a release build and run the release tests.
69+
70+
- Make sure the repository is clean `git clean -d -x -f --exclude="/Specs/e2e/*-snapshots/"`. **This will delete all files not already in the repository, excluding end to end testing snapshots.**
71+
- Run `npm install`.
72+
- Make sure `ThirdParty.json` is up to date by running `npm run build-third-party`. If there are any changes, verify and commit them.
73+
- Create the release zip `npm run make-zip`.
74+
- Run tests against the release `npm run test -- --failTaskOnError --release`.
75+
- Run [Sandcastle](http://localhost:8080/Apps/Sandcastle/index.html) and verify functionality from the patch is working as expected.
76+
77+
### 6. Push and tag the release commit
78+
79+
- Push your commits to the _current_ branch.
80+
- Create and push a [tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging), e.g., if the version string from previous steps is `1.123.1`, run:
81+
- `git tag -a 1.123.1 -m "1.123.1 release"`
82+
- `git push origin 1.123.1` (this assumes origin is the primary cesium repository; do not use `git push --tags` as it pushes all tags from all remotes you have on your system)
83+
84+
#### Commands
85+
86+
```sh
87+
git push
88+
git tag -a <version-tag> -m "<release-description>"
89+
git push origin <version-tag>
90+
```
91+
92+
### 7. Publish
93+
94+
#### a. Publish to npm
95+
96+
Continue with the normal `publish` command; There is no need to tag this differently than a typical release version.
97+
98+
- Use `npm publish --ws` in the repository root to publish the workspaces.
99+
- Use `npm publish` to publish the root package.
100+
101+
#### b. Publish to the website
102+
103+
**_Often, as is the case with issues arising from published dependency versions, a patch release only needs to be published to npm and does not need to be deployed to cesium.com. If that is the case, skip step 7b and proceed to step 8._**
104+
105+
- Check out the `cesium.com` branch.
106+
- Merge the new release tag into the `cesium.com` branch with `git merge origin <tag-name> --ff-only`.
107+
- Push the branch with `git push`. CI will deploy the hosted release, Sandcastle, and the updated doc.
108+
109+
### 8. Port the updates back to `main`
110+
111+
It's important that the latest version info goes back into the `main` branch to streamline future releases.
112+
113+
- Checkout `main` and pull the latest updates:
114+
- `git checkout main`
115+
- `git pull`
116+
- Checkout your patch release branch:
117+
- `git checkout <release-branch>`
118+
- [Optional] Create a new branch to perform the merge:
119+
- `git checkout -b <branch-name>`
120+
- Merge `main`, resolving any conflicts, particularly in `CHANGES.md`. Ensure the patch release _is_ included in the release notes, and ensure the specific patch fix descriptions are only listed once under the patch release.
121+
- `git merge main`
122+
- `git add .`
123+
- `git diff main`
124+
- Commit and push your changes:
125+
- `git commit -m "sync version info"`
126+
- `git push --set-upstream origin <branch-name>`
127+
- Open a new PR with the **priority - next release** label
128+
129+
### 9. Announce the release
130+
131+
Once the packages have been successfully published to npm, notify the interested developers that the release has been completed. This may include adding a comment to relevant GitHub issues that a fix has been published.

Documentation/Contributors/ReleaseGuide/Prereleases/README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Prereleases
22

3-
Occasionally, we need to release incremental versions of CesiumJS to npm prior to our typical [monthly train releases](../README.md). When this is necessary, we publish a **prerelease** version.
3+
Occasionally, we need to release incremental, opt-in versions of CesiumJS to npm prior to our typical [monthly train releases](../README.md) for early testing or internal use. When this is necessary, we publish a tagged **prerelease**[^1]. Prereleases are not guaranteed as stable and may not be compatable with official numbered releases.
44

5-
## Installing a prerelease version
5+
[^1]: See ["Adding dist-tags to packages" on docs.npmjs.com](https://docs.npmjs.com/adding-dist-tags-to-packages)
6+
7+
## Installing a prerelease
68

79
Use a prerelease tag—e.g. `ion`—to install a published prerelease.
810

@@ -20,9 +22,9 @@ npm install cesium@ion
2022

2123
## Do we need a prelease?
2224

23-
A prerelease version of CesiumJS typically _will not have the level of validation_ that the official monthly release receives. Additionally, [cherry picking commits](https://www.atlassian.com/git/tutorials/cherry-pick) for hot fixes can _complicate commit history and introduce bugs_. Consider if a prerelease is the ideal solution or if [continuous deployment artifacts](../../ContinuousIntegration/README.md#continuous-deployment) will suffice.
25+
A prerelease of CesiumJS typically _will not have the level of validation_ that the official monthly numbered release receives. Additionally, [cherry picking commits](https://www.atlassian.com/git/tutorials/cherry-pick) for hot fixes can _complicate commit history and introduce bugs_. Consider if a prerelease is the ideal solution or if [continuous deployment artifacts](../../ContinuousIntegration/README.md#continuous-deployment) will suffice.
2426

25-
## Publishing a prelease version
27+
## Publishing a prelease
2628

2729
This process is based on an abbreviated version of the [monthly release guide](../README.md). Familiarity with our typical release process is recommended, but not required.
2830

@@ -40,7 +42,7 @@ git checkout -b <branch-name>
4042

4143
### 2. Cherry pick relevant commits
4244

43-
- Use [`git-cherry-pick`](https://git-scm.com/docs/git-cherry-pick) one or more times to apply select commits to the current branch
45+
- Use [`git-cherry-pick`](https://git-scm.com/docs/git-cherry-pick) one or more times to apply select commits to the current branch.
4446
- As necessary, resolve any merge conflicts, add, and continue.
4547

4648
#### Commands
@@ -77,7 +79,7 @@ npm version prerelease --preid <tag> --no-git-tag-version
7779
- Move any relevant items in the list to the new header in `CHANGES.md`.
7880
- Delete any empty headers.
7981
- Ensure each change is nested in the section for the relevant workspace.
80-
- Commit any staged changed and push to your branch.
82+
- Commit any staged changes and push to your branch.
8183

8284
### 5. Release build and sanity test
8385

@@ -92,10 +94,10 @@ While the full extent of typical release testing is not required, at minimum, cr
9294

9395
### 6. Push and tag the release commit
9496

95-
- Push your commits to the _current_ branch
96-
- Create and push a [tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging), e.g., if the version string from previous steps is `1.123.1-ion.0`, run
97+
- Push your commits to the _current_ branch.
98+
- Create and push a [tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging), e.g., if the version string from previous steps is `1.123.1-ion.0`, run:
9799
- `git tag -a 1.123.1-ion.0 -m "1.123.1 ion prerelease"`
98-
- `git push origin 1.123.1-ion.0` (this assumes origin is the primary cesium repository; do not use `git push --tags` as it pushes all tags from all remotes you have on your system.)
100+
- `git push origin 1.123.1-ion.0` (this assumes origin is the primary cesium repository; do not use `git push --tags` as it pushes all tags from all remotes you have on your system)
99101

100102
#### Commands
101103

Documentation/Contributors/ReleaseGuide/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
We release CesiumJS on the first work day of every month.
44

55
- [**Release Schedule**](./ReleaseSchedule.md): The upcoming monthly release schedule and the developer responsible for managing each release
6-
- [**Perelease Guide**](./Prereleases/README.md): If and how to publish a prerelease version ahead of the typical monthly release
6+
- [**Patch Release Guide**](./PatchReleases/README.md): If and how to publish a patch release[^1] ahead of the regular monthly release, typically used in the case of a significant regression or an issue with published dependency versions.
7+
- [**Prerelease Guide**](./Prereleases/README.md): If and how to publish a tagged prerelease[^2] ahead of the regular monthly release, typically used for internal testing.
8+
9+
[^1]: See ["About semantic versioning" on docs.npmjs.com](https://docs.npmjs.com/about-semantic-versioning)
10+
11+
[^2]: See ["Adding dist-tags to packages" on docs.npmjs.com](https://docs.npmjs.com/adding-dist-tags-to-packages)
712

813
## Motivation
914

0 commit comments

Comments
 (0)