Skip to content

Publish NPM Latest

Publish NPM Latest #13

name: Publish NPM Latest
on:
workflow_call:
secrets:
CAP_GH_RELEASE_TOKEN:
required: true
NPM_TOKEN:
required: true
workflow_dispatch:
jobs:
deploy-npm-latest:
if: github.ref == 'refs/heads/4.x'
runs-on: macos-12
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
- uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Restore Dependency Cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-dependency-cache-${{ hashFiles('**/package.json') }}
- run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
npm whoami
npm install
- name: Version & Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
run: |
git config user.name "Github Workflow (on behalf of ${{ github.actor }})"
git config user.email "users.noreply.github.com"
npm run ci:publish:latest