Skip to content

Publish to GitHub Packages #5

Publish to GitHub Packages

Publish to GitHub Packages #5

Workflow file for this run

name: Publish to GitHub Packages
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js for GitHub Packages
uses: actions/setup-node@v4
with:
node-version: "18"
registry-url: "https://npm.pkg.github.com"
scope: "@sr2echa"
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
run: |
cd client
pnpm install
- name: Run tests (if any)
run: |
cd client
pnpm test --if-present
- name: Pack the package (check)
run: |
cd client
npm pack
- name: Publish to GitHub Packages
run: |
cd client
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}