Publish Packages with a Job or Pipeline
You can create a build job or pipeline to publish a JS package (or multiple packages) to the project's NPM registry: Here's how to configure a build job that does that:
- From the Jobs Overview page, click Configure to bring up the Job Configuration page.
- In the Configure
view, select the Git tab, and configure Git. Select the repository and the branch or tag.
- In the Before Build tab, click Add Before Build Action and select NPM Registry Connection. Select Use project's NPM registry. Notice that the Registry URL is displayed, but is grayed out.
- In the Steps tab, add a Unix Shell step with a script, similar to
this:
Description of the illustration npm_job_config_unix_shell_build_step.pngTip:
You may want to configure an additional Unix Shell build step that audits the package's dependencies, sets a minimum audit threshold level for failure, and fixes vulnerabilities that were discovered as a result of the audit. See Check for Security Vulnerabilities in your Project's NPM Packages and Dependencies for more information about implementing these options. - In the Settings
view, select the Software tab.
Make sure that the selected Software template lists one of these Node.js versions in the Available Software section:- Node.js 18 (Version 18.18.1)
- Node.js 20 (Version 20.8.0)
- Click Save.
A build job that has been configured in this manner can be included in a pipeline and, after it has been executed successfully, the pipeline build information will be displayed in the Build Details section in the NPM page's Package Details section.