Skip to content

feat(ui): component folders, Layout suite, CI, and Vitest #80

feat(ui): component folders, Layout suite, CI, and Vitest

feat(ui): component folders, Layout suite, CI, and Vitest #80

Workflow file for this run

name: Build And Publish Nova UI

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

(Line: 26, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.NPM_TOKEN == ''
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: npm
- name: Ensure npm token exists
if: ${{ secrets.NPM_TOKEN == '' }}
run: |
echo "NPM_TOKEN secret is missing."
exit 1
- name: Install Dependencies
run: npm ci
- name: Build UI Package
run: npm run build:ui
- name: Read Package Info
id: pkg
shell: bash
run: |
PKG_NAME=$(node -p "require('./packages/ui/package.json').name")
PKG_VERSION=$(node -p "require('./packages/ui/package.json').version")
echo "name=$PKG_NAME" >> "$GITHUB_OUTPUT"
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
- name: Check Version Exists
id: check
shell: bash
run: |
if npm view "${{ steps.pkg.outputs.name }}@${{ steps.pkg.outputs.version }}" version > /dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Version already exists, skip publish."
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Publish Package
if: steps.check.outputs.exists == 'false'
run: npm publish --access public --workspace @wuyangfan/nova-ui
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}