Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Publish
on:
push:
tags: ['v*']
permissions:
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
environment: npm-release
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- run: npm ci
- run: npm test
- run: npm publish --access public
21 changes: 16 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
# Deploying a new release

- `npm test`
- `npm version {patch|minor|major}`
- `npm publish`
- `git push --follow-tags`
- `aws s3 cp --acl public-read mapbox-gl-supported.js s3://mapbox-gl-js/plugins/mapbox-gl-supported/v$(node --print --eval "require('./package.json').version")/mapbox-gl-supported.js`
Publishing to npm happens via [Trusted Publishing](https://docs.npmjs.com/trusted-publishers) through the `.github/workflows/npm-release.yml` GitHub Actions workflow, triggered by pushing a `v*` tag.

**One-time setup** (already done for this repo, kept here for reference):

- GitHub repo settings → Environments → New environment → `npm-release`
- Selected branches and tags → Add rule → Ref type: Tag → `v*`
- On npmjs.com, configure this repo + workflow + `npm-release` environment as a Trusted Publisher for `@mapbox/mapbox-gl-supported`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not worth keeping the reference in this repo, but fine either way


**Releasing**:

- `npm version {patch|minor|major}`
- Push the version bump commit as a PR. Get it green, approved and merged.
- Once everything looks good, `git push --tags` to release. This triggers the `npm-release` workflow, which publishes to npm.
- Upload the built browser bundle to the CDN:
- `npm run build`
- `aws s3 cp --acl public-read mapbox-gl-supported.js s3://mapbox-gl-js/plugins/mapbox-gl-supported/v$(node --print --eval "require('./package.json').version")/mapbox-gl-supported.js`