Skip to content

Commit 5f81bed

Browse files
authored
New release workflow (#565)
1 parent cd7d9c9 commit 5f81bed

2 files changed

Lines changed: 30 additions & 11 deletions

File tree

‎.github/workflows/npm-release.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish
2+
on:
3+
push:
4+
tags: ['v*']
5+
permissions:
6+
id-token: write
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: npm-release
11+
steps:
12+
- uses: actions/checkout@v7
13+
- uses: actions/setup-node@v7
14+
with:
15+
node-version: 24
16+
- run: npm ci
17+
- run: npm publish --access public

‎CONTRIBUTING.md‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,23 @@ Follow this deploy process after all changes for the release are merged into mai
2525
## Release checklist
2626
2727
1. Create a branch off `main` and a pull request with the following changes. Copy this checklist in the comment of the pull request.
28-
- [ ] Update the [CHANGELOG.md](https://github.com/mapbox/mapbox-gl-geocoder/blob/main/CHANGELOG.md) by comparing the last release and what is on `main`. In the changelog, replace the `HEAD` heading with the to-be-released stable version.
28+
- [ ] Update the [CHANGELOG.md](https://github.com/mapbox/mapbox-gl-geocoder/blob/main/CHANGELOG.md) by comparing the last release and what is on `main`. In the changelog, add the to-be-released stable version heading below `HEAD`.
2929
- [ ] Update the version number in `package.json` and `package-lock.json`.
30-
3. Request a PR review and then merge it into `main`.
31-
4. Tag the release and start the build.
32-
- [ ] Make sure you've pulled in all changes to `main` locally.
33-
- [ ] Build the release with `npm run prepublish && npm run docs`
34-
- [ ] Commit and push with commit message `vX.X.X`
35-
- [ ] Create the git tag for the release with `git tag -a vX.X.X -m 'vX.X.X'`
36-
- [ ] Push the tags with `git push --tags`
37-
- [ ] Run `mbx npm publish`
30+
- [ ] Run `npm run docs` and commit any changes to `API.md`.
31+
2. Request a PR review and then merge it into `main`.
32+
3. Tag the merge commit and publish.
33+
- [ ] Create the git tag with `git tag -a vX.X.X -m 'vX.X.X'` on the merged commit
34+
- [ ] Push it with `git push origin vX.X.X`. This starts the `Publish` workflow, which publishes to npm once the `npm-release` environment is approved.
35+
- [ ] Create a GitHub release for the tag with the changelog entry.
3836
3937
4038
## Post-release checklist
4139
42-
Update version number in GL JS examples at [https://github.com/mapbox/mapbox-gl-js-docs](https://github.com/mapbox/mapbox-gl-js-docs):
40+
Upload to the CDN (make sure you are authenticated for AWS):
4341
44-
sed -i '' 's/mapbox-gl-geocoder\/v[^\/]*\//mapbox-gl-geocoder\/vX.X.X\//g' docs/pages/example/*.html
42+
git checkout vX.X.X
43+
npm ci
44+
aws s3 cp --recursive --acl public-read dist s3://mapbox-gl-js/plugins/mapbox-gl-geocoder/vX.X.X
45+
46+
Update the geocoder version in `src/components/example/helpers.js` of [mapbox-gl-js-docs](https://github.com/mapbox/mapbox-gl-js-docs).
4547
```

0 commit comments

Comments
 (0)