chore(deps): update all non-major dev-dependencies (#204) #234
This file contains 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: "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: Use Node.js v18 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
registry-url: https://registry.yarnpkg.com/ | |
- name: Install Dependencies | |
run: yarn --immutable | |
- name: Building the app | |
run: yarn 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 }}') | |
yarn config set npmAuthToken ${NODE_AUTH_TOKEN} | |
yarn config set npmPublishRegistry "https://registry.yarnpkg.com" | |
yarn bump -n "@${{ github.repository }}" -p . --preid "${TAG}.$(git rev-parse --verify --short HEAD)" | |
yarn npm publish --tag ${TAG} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |