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:

  1. From the Jobs Overview page, click Configure to bring up the Job Configuration page.
  2. In the Configure Configure job view view, select the Git tab, and configure Git. Select the repository and the branch or tag.
  3. 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.
  4. In the Steps tab, add a Unix Shell step with a script, similar to this:
    Description of npm_job_config_unix_shell_build_step.png follows
    Description of the illustration npm_job_config_unix_shell_build_step.png

    Tip:

    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.
  5. In the Settings the Gear icon 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 17(Version 17.6.0)
    • Node.js 16 (Version 16.14.0)
    • Node.js 14 (Version 14.19.0)
    If the job doesn't use one of these Node.js versions, the build information won't be displayed in Build Details on the NPM page's Package Details section.
  6. 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.