Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish NPM Package

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8

- name: Install dependencies
working-directory: ./ui/ModelModal
run: pnpm install

- name: Build package
working-directory: ./ui/ModelModal
run: pnpm build

- name: Update package version from tag
working-directory: ./ui/ModelModal
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
npm version $TAG_VERSION --no-git-tag-version

- name: Publish to NPM Registry
working-directory: ./ui/ModelModal
run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}