Skip to content

⬆️ Update devDependencies (#87) #55

⬆️ Update devDependencies (#87)

⬆️ Update devDependencies (#87) #55

Workflow file for this run

name: Publish to NPM
on:
push:
paths:
- 'package.json'
branches:
- main
workflow_dispatch:
jobs:
Check-Versions:
runs-on: ubuntu-latest
outputs:
outdated: ${{ steps.version_check.outputs.outdated }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
always-auth: true
- name: Compares Versions
id: version_check
run: |
node ./scripts/predeploy.js
echo "outdated=$(node ./scripts/predeploy.js)" >> $GITHUB_OUTPUT
Build-Publish:
needs: Check-Versions
if: ${{needs.Check-Versions.outputs.outdated}}
runs-on: ubuntu-latest
steps:
- name: Is Outdated
run: echo ${{needs.Check-Versions.outputs.outdated}}
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
always-auth: true
- name: Install pnpm
uses: pnpm/action-setup@v2.4.0
id: pnpm-install
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
pnpm store path
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm i
- name: Build package
run: pnpm run build
- name: SetupAuth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish package on NPM 📦
run: pnpm publish
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}