You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,40 @@ Miscellaneous notes:
70
70
71
71
## Versioning and publishing to npm
72
72
73
-
> Releases can be automated via [Actions → "Release to npm"](https://github.com/OpenHistoricalMap/map-styles/actions/workflows/release.yml) — click **Run workflow**, choose `patch` / `minor` / `major`, and it builds `/dist`, commits, tags, and publishes with provenance via npm Trusted Publishers (no token required). Manual steps below remain as a fallback.
73
+
Releases are **manually triggered** via the [Release to npm](https://github.com/OpenHistoricalMap/map-styles/actions/workflows/release.yml) GitHub Action. Authentication uses npm [Trusted Publishers](https://docs.npmjs.com/trusted-publishers) (OIDC) — no tokens required.
74
+
75
+
### How to release
76
+
77
+
1. Make sure your changes are merged into `staging` (PRs are validated automatically by [`validate.yml`](.github/workflows/validate.yml) on every push).
78
+
2. Go to [Actions → "Release to npm" → Run workflow](https://github.com/OpenHistoricalMap/map-styles/actions/workflows/release.yml).
79
+
3. Pick the branch `staging` and the bump type (`patch` / `minor` / `major`), then click **Run workflow**.
80
+
4. The workflow rebuilds `/dist`, creates a single commit `Packaging X.Y.Z with rebuilt /dist`, tags it `vX.Y.Z`, pushes to `staging`, and publishes to npm with verified provenance.
81
+
5. Update the OHM properties that depend on `map-styles`. For `ohm-website`, [Dependabot](https://docs.github.com/en/code-security/dependabot) runs daily and will automatically open a PR bumping the `yarn.lock` within ~24 hours of the publish — just review and merge it. The manual fallback steps are documented in the [ohm-website](#ohm-website) section below.
82
+
83
+
### Why manual?
84
+
85
+
Manual triggering lets us:
86
+
- Batch multiple PRs into a single release (no version churn).
87
+
- Choose `patch` / `minor` / `major` per release.
88
+
- Avoid publishing on irrelevant changes (README edits, refactors, etc.).
89
+
90
+
### Switching to automatic releases
91
+
92
+
If the team prefers, the workflow can be set to publish automatically on every merge to `staging` by adding a `push` trigger in [`.github/workflows/release.yml`](.github/workflows/release.yml):
93
+
94
+
```yaml
95
+
on:
96
+
push:
97
+
branches: [staging]
98
+
workflow_dispatch:
99
+
inputs: ...
100
+
```
101
+
102
+
A middle ground is to trigger releases only when a PR is merged with a `release` label. See the [GitHub Actions docs](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows) for other trigger options.
103
+
104
+
### Manual fallback (without the workflow)
105
+
106
+
If the GitHub Action is unavailable, the release can be done locally:
74
107
75
108
1. increment the version in `package.json`, e.g., `0.9.7`
76
109
1. commit your style changes, including `/dist/*` & `package.json`, push to GitHub, and [create a corresponding release](https://github.com/OpenHistoricalMap/map-styles/releases/new), e.g., `v0.9.7`
0 commit comments