Skip to content

Commit e8d18d1

Browse files
authored
Merge pull request #1812 from Dexterp37/alpha-ci
Bug 1863916 - Add support for cutting 'prerelease' releases
2 parents 457ab64 + abf6dba commit e8d18d1

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

.circleci/config.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,30 @@ jobs:
213213
- run:
214214
name: NPM Authentication
215215
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > glean/.npmrc
216-
- run:
217-
name: Publish to npm
218-
command: export PATH=.:$PATH && (cd glean && npm publish --access public)
216+
# This conditional matches the tag that contains 'pre', used
217+
# to mark prerelease builds. Since CircleCI conditionals do
218+
# not directly support 'else's, we need another conditional.
219+
- when:
220+
condition:
221+
matches:
222+
pattern: "^v.*-pre.*$"
223+
value: << pipeline.git.tag >>
224+
steps:
225+
- run:
226+
name: Publish to npm (prerelease)
227+
command: export PATH=.:$PATH && (cd glean && npm publish --access public --tag prerelease)
228+
# This conditional matches 'release': we won't tag the npm
229+
# release in this case, because no 'pre' is found in the tag.
230+
- when:
231+
condition:
232+
not:
233+
matches:
234+
pattern: "^v.*-pre.*$"
235+
value: << pipeline.git.tag >>
236+
steps:
237+
- run:
238+
name: Publish to npm
239+
command: export PATH=.:$PATH && (cd glean && npm publish --access public)
219240
- run:
220241
name: Get ghr release tool
221242
command: |

.dictionary

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ md
6161
mdroettboom
6262
mozilla
6363
npm
64+
prerelease
6465
runtime
6566
schemas
6667
setRawNanos

docs/guides/release.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,24 @@ That package will contain sub packages with Glean.js builds for each environment
66

77
The development & release process roughly follows the [Git Flow model](https://nvie.com/posts/a-successful-git-branching-model/).
88

9-
> **Note**: The rest of this section assumes that `upstream` points to the `https://github.com/mozilla/glean.js` repository, while `origin` points to the developer fork. For some developer workflows, `upstream` can be the same as `origin`.
9+
> [!NOTE]
10+
> The rest of this section assumes that `upstream` points to the `https://github.com/mozilla/glean.js` repository, while `origin` points to the developer fork. For some developer workflows, `upstream` can be the same as `origin`.
1011
1112
## Standard release
1213

1314
Releases can only be done by one of the Glean maintainers.
1415

1516
- Main development branch: `main`
1617
- Main release branch: `release`
17-
- Specific release branch: `release-vX.Y.Z`
18+
- Specific release branch: `release-vX.Y.Z` (or `release-vX.Y.Z-pre.N` for prerelease)
19+
20+
> [!IMPORTANT]
21+
> Adding a suffix to the version **and** the branch/tag names such as
22+
> `-pre.0` triggers publishing to the NPM `prerelease` channel. This enables early
23+
> consumers to test the latest capabilities, without widely rolling them out to
24+
> all the consumers.
25+
> If cutting a prerelease, whenever `release-vX.Y.Z` is specified in the rest of the
26+
> document assume it refers to `release-vX.Y.Z-pre.N`.
1827
1928
### Create a release branch
2029

0 commit comments

Comments
 (0)