Publish Package to npmjs #76
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: 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 }} |