Skip to content
Merged
Show file tree
Hide file tree
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
74 changes: 74 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish npm

on:
push:
tags:
- "v*.*.*"

permissions:
contents: read
id-token: write

jobs:
publish:
name: Publish @flowscape-ui/core-sdk
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false

- name: Verify runtime versions
run: |
node --version
npm --version
bun --version

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Check formatting
run: bun run format:check

- name: Lint
run: bun run lint

- name: Typecheck
run: bun run typecheck

- name: Build
run: bun run build

- name: Verify release version
shell: bash
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
PACKAGE_VERSION=$(node -p "require('./packages/engine/package.json').version")

echo "Tag version: $TAG_VERSION"
echo "Package version: $PACKAGE_VERSION"

if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "::error::Git tag v$TAG_VERSION does not match packages/engine/package.json version $PACKAGE_VERSION"
exit 1
fi

- name: Inspect npm package
working-directory: packages/engine
run: npm pack --dry-run

- name: Publish package
working-directory: packages/engine
run: npm publish --access public
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"dev:playground": "turbo run dev --filter=@flowscape-ui/playground",
"dev:docs": "turbo run dev --filter=@flowscape-ui/docs",
"build:playground": "turbo run build --filter=@flowscape-ui/playground",
"build:docs": "turbo run build --filter=@flowscape-ui/docs"
"build:docs": "turbo run build --filter=@flowscape-ui/docs",
"version:patch": "cd packages/engine && bun pm version patch --no-git-tag-version && cd ../.. && bun install --lockfile-only",
"version:minor": "cd packages/engine && bun pm version minor --no-git-tag-version && cd ../.. && bun install --lockfile-only",
"version:major": "cd packages/engine && bun pm version major --no-git-tag-version && cd ../.. && bun install --lockfile-only"
},
"devDependencies": {
"prettier": "^3.7.4",
Expand Down
Loading