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.
Reusable workflow for checking broken links in markdown files using lychee. The calling repository provides its own lychee.toml configuration file in the repo root.
name: Link Check
on:
push:
branches: [main]
paths: ["**/*.md", "lychee.toml", ".lycheeignore"]
pull_request:
paths: ["**/*.md", "lychee.toml", ".lycheeignore"]
schedule:
- cron: "0 8 * * 1"
workflow_dispatch:
permissions:
contents: read
jobs:
check-links:
uses: tetrascience/ts-ci-cd-lib/.github/workflows/check-links.yml@main| Input | Description | Required | Default |
|---|---|---|---|
lychee_args |
Arguments passed to lychee. The calling repo's lychee.toml handles most configuration. |
No | "--cache --max-cache-age 1d ." |
No secrets required. The workflow uses the automatically available GITHUB_TOKEN for authenticating with the GitHub API (to avoid rate limits when checking GitHub links).
Create a lychee.toml file in your repository root:
max_concurrency = 4
max_retries = 3
timeout = 20
accept = [200, 204, 301, 429]
exclude = [
"^http://localhost",
"^http://127\\.0\\.0\\.1",
"^https?://example\\.com",
]