Skip to content

Publish to NPM

Publish to NPM #2

Workflow file for this run

name: Publish nightly to NPM
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
Publish:
name: Publish to NPM
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: ./v1/typescript-definitions
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 24
package-manager-cache: false
registry-url: "https://registry.npmjs.org"
# Ensure npm 11.5.1 or later is installed:
# - name: Update npm
# run: npm install -g npm@latest
- name: Prepare Environment
# Install from package-lock.json:
run: npm ci
env:
CI: true
- name: Get the Prerelease tag
id: prerelease-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@2b0614b1338c8f19dd9d3ea433ca9bc0cc7057ba
with:
remove-version-tag-prefix: false
- name: Bump version to prerelease
run: |
PRERELEASE_TAG=nightly-$(echo "${{ steps.prerelease-tag.outputs.tag }}" | sed -r 's/[^a-z0-9]+/-/gi')
npm version prerelease --preid $PRERELEASE_TAG-$COMMIT_DATE-$GIT_HASH
- name: Generate types
run: npm run generate-types
env:
CI: true
- name: Build
run: npm run build
env:
CI: true
- name: Publish to NPM
run: npm publish --tag nightly
env:
CI: true