Key Takeaways
- A central reusable _quality.yml workflow eliminates duplicate lint, typecheck, and test boilerplate across PRs, Pages deployments, and npm releases.
- Packaging validation runs publint plus an actual tsc NodeNext consumer check before any tarball reaches npmjs.org.
- Keeping a dedicated release.yml workflow filename preserves npm OIDC Trusted Publishing provenance while gating publication behind precheck and quality jobs.
In a multi-package workspace shipping @simplex-viz/core, @simplex-viz/svg, @simplex-viz/react, and an Astro 7 documentation site, naive workflow setups tend to drift in two directions: either workflows copy-paste the same pnpm install + lint + test blocks into three separate files, or deployment pipelines push artifacts without waiting for package tests to pass.
One Reusable _quality.yml Workflow via workflow_call
SimplexViz separates quality verification from delivery targets:
_quality.yml(Reusable Gate): Executes once per workflow invocation with read-only permissions (contents: read) and strict timeouts—runningpnpm install --frozen-lockfile, ESLint module-boundary checks (no DOM/React in core), TypeScript typechecking across all packages/app/scripts,pnpm sync:brand:check,pnpm build:packages,pnpm validate:packages(publint), Vitest with coverage (including theNodeNext.d.tsintegration test), and the Astro production build.ci.yml: Triggers_quality.ymlon pull requests and branch pushes.deploy-pages.yml: Calls_quality.ymlfirst, passing the static build only after every package invariant and brand check is green, then deploys to GitHub Pages withpages: writeandid-token: write.
Precheck → Quality Gate → OIDC Trusted Publishing
Because npm OIDC Trusted Publishing binds package provenance strictly to the repository and exact workflow filename (release.yml), releasing stays isolated in release.yml with three cleanly scoped stages:
precheck: Verifies that@simplex-viz/core,@simplex-viz/svg, and@simplex-viz/reactshare one synchronized semantic version (enforced by Changesetsfixedgroups) and checksnpm viewbefore provisioning heavier runners—skipping cleanly if the version is already live on npmjs.org.quality: Invokes./.github/workflows/_quality.ymlonly whenshould_publish == 'true', ensuring no untested package or broken.d.tsexport can ever reach npm.publish: Upgrades the npm CLI for OIDC compatibility, builds andpublint-validates tarballs withNPM_CONFIG_PROVENANCE: true, publishes in dependency order (core→svg→react) viapnpm --filter ... publish, and creates the matching GitHub Release with notes extracted directly fromCHANGELOG.md.