v0.2.6 #8
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NPM Package | |
# Triggers for the workflow | |
on: | |
# Automatically run when a new release is created | |
release: | |
types: [created] | |
# Allow manual triggering of the workflow | |
workflow_dispatch: | |
jobs: | |
publish: | |
# Runs on the latest Ubuntu runner | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository code | |
# This brings the repository contents into the GitHub Actions runner | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js environment | |
# Configures Node.js version 20 and sets up NPM registry | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
registry-url: 'https://registry.npmjs.org' | |
# Step 3: Install project dependencies | |
# Uses npm ci for clean, reproducible installations | |
- name: Install dependencies | |
run: npm ci | |
# Step 4: Build the TypeScript library | |
# Runs the build script to compile TypeScript to JavaScript | |
- name: Build TypeScript | |
run: npm run build:lib | |
# Step 5: Publish the package to NPM | |
# Uses the NPM_TOKEN secret for authentication | |
- name: Publish to NPM | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |