Skip to content

Publish

Publish #37

Workflow file for this run

name: Publish
on:
workflow_dispatch:
jobs:
generateDocs:
runs-on: ubuntu-latest
name: Generate docs
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Get npm cache directory
id: npm-cache
run: |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Generate
run: npx typedoc
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
if-no-files-found: error
retention-days: 1
publishNPM:
runs-on: ubuntu-latest
name: Publish to npm
needs: [generateDocs]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: build
run: npm run build
- name: Download docs
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release