Skip to content

Publish Latest to NPM #11

Publish Latest to NPM

Publish Latest to NPM #11

name: Publish Latest to NPM
on:
workflow_call:
secrets:
TONEFLIX_RELEASE_TOKEN:
required: true
NPM_TOKEN:
required: true
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
deploy-npm-latest:
if: github.ref == 'refs/heads/main'
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.TONEFLIX_RELEASE_TOKEN }}
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Set Node.js 22.x
uses: actions/setup-node@v4
with:
registry-url: https://registry.npmjs.org/
node-version: 22
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Add token to NPMRC
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.TONEFLIX_RELEASE_TOKEN }}" >> ~/.npmrc
- name: Version & Publish
env:
GH_TOKEN: ${{ secrets.TONEFLIX_RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
git config user.name "Github Workflow (on behalf of ${{ github.actor }})"
git config user.email "users.noreply.github.com"
pnpm whoami
pnpm run ci:publish:latest