Releasing
How a version of petal-elements is published. Only maintainers do this.
One-time setup
Link to “One-time setup”- On GitHub, in the repository settings:
- Pages > Build and deployment > Source: "GitHub Actions" (for the catalog,
.github/workflows/catalog.yml). - Environments: create
npm, and add required reviewers so that every publish waits for approval. - Secrets: add an npm automation token as
NPM_TOKEN. - Security: turn on private vulnerability reporting (see SECURITY.md).
- Pages > Build and deployment > Source: "GitHub Actions" (for the catalog,
- Run the "Visual baselines" workflow once and commit the Linux baseline it produces (see Visual testing).
Each release
Link to “Each release”Update
CHANGELOG.md: move the entries from "unreleased" to the new version with the date.Set
versioninpackage.json(and runnpm installso thatpackage-lock.jsonfollows).Check locally:
content_copy check npm ci npm run check:licenses npm run check:rebrand npm run build npm run check:tokens npm test npm run test:visual npm pack --dry-run # look at the file listCommit, then tag and push:
content_copy check git tag v0.1.0 git push origin main v0.1.0The "Release" workflow (
.github/workflows/release.yml) runs the checks again and publishes to npm with provenance, after approval in thenpmenvironment. It fails if the tag does not matchpackage.json.Create a GitHub release for the tag with the changelog entries.
What is published
Link to “What is published”The npm package contains the compiled components (*.js, *.d.ts, *.css), the Sass sources (*.scss), the token files (tokens/css/, tokens/dtcg/web/, tokens/sources.json), custom-elements.json, LICENSE, NOTICE and the READMEs. Tests, scripts, docs and the catalog are not published; see files in package.json.