Skip to content

chore(deps): update pnpm to v9.14.3 (#216) #235

chore(deps): update pnpm to v9.14.3 (#216)

chore(deps): update pnpm to v9.14.3 (#216) #235

name: "cd(NPM): next version bump"
on:
workflow_dispatch:
inputs:
prNumber:
description: The number of the PR that is being deployed
required: true
ref:
description: The branch that is being deployed. Should be a branch on the given repository
required: false
default: main
push:
branches:
- main
jobs:
Publish:
if: github.repository != 'snowcrystals/template'
name: Publish Next to npm
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || 'main' }}
- name: Setup pnpm
uses: pnpm/action-setup@v3
- name: Use Node.js v18
uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Building the app
run: pnpm run build
- name: Bump Version & Publish
run: |
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events.
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}')
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > .npmrc
pnpm run bump -n "@${{ github.repository }}" -p . --preid "${TAG}.$(git rev-parse --verify --short HEAD)"
pnpm publish --access public --no-git-checks --tag ${TAG}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}