Skip to content

Commit 98f36b3

Browse files
committed
CLOUDPLAT-3162: add npm OIDC publish workflow
https://mapbox.atlassian.net/browse/CLOUDPLAT-3162
1 parent ae2a3ab commit 98f36b3

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/npm-release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: NPM release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
npm-release:
8+
uses: mapbox/gha-public/.github/workflows/workflow-npm-oidc-publish.yml@main
9+
permissions:
10+
id-token: write
11+
contents: write
12+
with:
13+
create-github-release: true
14+
environment: npm-release
15+
run-tests: false

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,19 @@ Our labeling system is
213213
- [Drawing Text with Signed Distance Fields in Mapbox GL](https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817)
214214
- [Map Label Placement in Mapbox GL](https://blog.mapbox.com/map-label-placement-in-mapbox-gl-c6f843a7caaa)
215215
- [Signed Distance Fields](http://bytewrangler.blogspot.com/2011/10/signed-distance-fields.html)
216+
217+
## Releasing a new version
218+
219+
Releases are published to npm via GitHub Actions.
220+
221+
### Steps
222+
223+
1. **Bump the version** in `package.json` (follow [semver](https://semver.org))
224+
2. **Update `CHANGELOG.md`** with a summary of what changed
225+
3. **Open a PR**, get it reviewed and merged to `main`
226+
4. **Trigger the release** from the [Actions tab](../../actions/workflows/npm-release.yml):
227+
- Select **NPM release****Run workflow** → run from `main`
228+
229+
The workflow will publish to npm and create a GitHub release with auto-generated notes.
230+
231+
> **Note:** Only Mapbox maintainers with write access to this repository can trigger the release workflow. External contributors can open and contribute to PRs, but releases are always cut by the owning team.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "mapbox-gl",
33
"description": "A WebGL interactive maps library",
4-
"version": "3.25.0",
4+
"version": "3.25.1",
55
"main": "dist/mapbox-gl.js",
66
"style": "dist/mapbox-gl.css",
77
"types": "dist/mapbox-gl.d.ts",
@@ -234,5 +234,8 @@
234234
"name": "UMD bundle (gzip)",
235235
"path": "dist/mapbox-gl.js"
236236
}
237-
]
237+
],
238+
"publishConfig": {
239+
"access": "public"
240+
}
238241
}

0 commit comments

Comments
 (0)