Skip to content

Workflow file for this run

name: Publish Package to GitHub Packages
on:
workflow_dispatch:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get Node.js version from .nvmrc
shell: bash
run: |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_ENV
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://npm.pkg.github.com"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Publish to NPM
run: pnpm publish --publish-branch main --force
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}