Skip to content

Publish Latest to NPM #2

Publish Latest to NPM

Publish Latest to NPM #2

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 }}
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
cache: yarn
cache-dependency-path: '**/package.json'
- run: |
yarn
- 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"
npm whoami
npm run ci:publish:latest