Skip to content

Publish package to GitHub Packages #11

Publish package to GitHub Packages

Publish package to GitHub Packages #11

Workflow file for this run

name: Publish package to GitHub Packages
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
# Setup .npmrc file to publish to GitHub Packages
- name: Install Node.js and Setup NPMRC
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
scope: "@oconva"
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Set NPM Auth Token
run: pnpm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
- name: Publish 🚀
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}