Skip to content

Publish to npm

Publish to npm #20

Workflow file for this run

name: Publish to npm
on:
release:
types: [created]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout repository
uses: actions/checkout@v5
- name: 🧰 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.17.1
run_install: false
- name: πŸ”§ Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 22
cache: 'pnpm'
- name: πŸ“¦ Install dependencies
run: pnpm install
- name: πŸ›  Build package
run: pnpm build
# ----------------------------
# βœ… GitHub Packages Publish
# ----------------------------
# - name: πŸ“¦ Configure .npmrc for GitHub Packages
# run: |
# echo "@interactive-video-labs:registry=https://npm.pkg.github.com/" > ~/.npmrc
# echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_PUBLISH_PAT }}" >> ~/.npmrc
# - name: πŸš€ Publish to GitHub Packages
# run: pnpm publish --no-git-checks --registry=https://npm.pkg.github.com/
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GH_PUBLISH_PAT }}
# ----------------------------
# βœ… npmjs.com Publish
# ----------------------------
- name: πŸ“¦ Configure .npmrc for npmjs
run: |
echo "@interactive-video-labs:registry=https://registry.npmjs.org/" > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
- name: πŸš€ Publish to npmjs
run: pnpm publish --access public --no-git-checks --registry=https://registry.npmjs.org/
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}