Skip to content

Publish Package to npmjs #76

Publish Package to npmjs

Publish Package to npmjs #76

Workflow file for this run

name: Manual Publish with OTP
on:
workflow_dispatch:
inputs:
otp:
description: "Enter your npm 2FA OTP code"
required: true
permissions:
contents: write
pull-requests: write
id-token: write
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository_owner == 'rphlmr'
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 👷 Install pnpm
uses: pnpm/action-setup@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
- name: 📥 Install dependencies
run: pnpm install --frozen-lockfile
- name: 🛡️ Mask OTP
run: echo "::add-mask::${{ github.event.inputs.otp }}"
- name: 🦋 Publish manually with OTP
run: pnpm run release --otp "$OTP"
env:
OTP: ${{ github.event.inputs.otp }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}