Reusable CI/CD workflows for TetraScience repositories.
Reusable workflow for publishing npm packages to JFrog Artifactory or the public npm registry.
name: Publish
on:
push:
tags:
- "v*"
jobs:
publish:
uses: tetrascience/ts-ci-cd-lib/.github/workflows/publish-npm-package.yml@main
with:
node_version: "20"
secrets:
AUTH_TOKEN: ${{ secrets.JFROG_AUTH_TOKEN }}
REGISTRY: ${{ secrets.JFROG_NPM_REGISTRY }}
PUBLISH_REGISTRY: ${{ secrets.JFROG_NPM_PUBLISH_REGISTRY }}| Input | Description | Required | Default |
|---|---|---|---|
node_version |
Node.js version | No | "20" |
prerelease_tag |
Prerelease tag for version suffix and npm dist-tag (e.g., alpha, beta). Leave empty for non-prerelease versions. | No | "" |
run_tests |
Whether to run tests before publishing | No | true |
publish_to_public_npm |
Set to true to confirm publishing to public npm registry | No | false |
| Secret | Description | Required |
|---|---|---|
AUTH_TOKEN |
Authentication token for JFrog Artifactory | Yes |
REGISTRY |
JFrog Artifactory npm registry URL (for installing dependencies) | Yes |
PUBLISH_REGISTRY |
Registry URL for publishing the package | Yes |
NPM_TOKEN |
npm token (required when publishing to public npm registry) | No |
To publish to the public npm registry (https://registry.npmjs.org):
- Set
publish_to_public_npm: truein the workflow inputs - Provide the
NPM_TOKENsecret - Set
PUBLISH_REGISTRYtohttps://registry.npmjs.org
The workflow will automatically update the package scope from @tetrascience to @tetrascience-npm when publishing to the public registry.