Skip to content

Multi‑chart dashboarding #1

Multi‑chart dashboarding

Multi‑chart dashboarding #1

Workflow file for this run

name: Publish to GitHub Packages
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Verify release tag matches package version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
node -e "const fs=require('fs');const v=JSON.parse(fs.readFileSync('package.json','utf8')).version;const t=(process.env.RELEASE_TAG||'').replace(/^v/,'');if(!t){console.error('Missing release tag');process.exit(1)};if(t!==v){console.error(`Release tag (${process.env.RELEASE_TAG}) does not match package.json version (${v})`);process.exit(1)};console.log(`Version OK: ${v}`);"
- name: Build
run: npm run build
# GitHub Packages npm registry requires a scoped package name that matches the owner/org.
# We scope it only at publish-time so the source package name can stay unscoped for npmjs.org if desired.
- name: Scope package name for GitHub Packages
run: |
node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));p.name='@chartgpu/chartgpu-react';fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n');"
- name: Configure npm for GitHub Packages
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://npm.pkg.github.com"
- name: Publish
run: npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}