Publish to npm #20
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 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 }} |