Interview Prep/CI/CD/Build Tools and Artifact Repositories

What do `npm run build`, `npm test` and `npm publish` do in a pipeline?

BeginnerConceptBuild Tools and Artifact Repositories
Answer

They execute scripts defined in package.json scripts (build, test) or publish the package to the configured registry. npm publish uses an auth token in .npmrc (for CI, //registry.npmjs.org/:_authToken=${NPM_TOKEN}), and --provenance attaches a signed provenance statement when run from a supported CI such as GitHub Actions with OIDC.

npm publish --provenance --access public
All CI/CD questions Roadmap: CI/CD fundamentals

More on Build Tools and Artifact Repositories