From 994f1d3b44fab26565b779f4067ceed012dbc2a4 Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 20 Jun 2026 11:23:17 +0800 Subject: [PATCH 1/4] ci(release): add smoke tests to local release stage --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48abfda8..12f23936 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,3 +46,21 @@ jobs: - name: Test Local Release run: | bun run release:local --skip-check --out /tmp/shumai-local-release --force + + echo "Smoke testing shumai..." + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai/bin/shumai-app.js & + PID1=$! + sleep 3 + kill -0 $PID1 && kill $PID1 + + echo "Smoke testing shumai-agent..." + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-agent/bin/shumai-agent-app.js & + PID2=$! + sleep 3 + kill -0 $PID2 && kill $PID2 + + echo "Smoke testing shumai-transcode..." + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-transcode/bin/shumai-transcode-app.js & + PID3=$! + sleep 3 + kill -0 $PID3 && kill $PID3 From d1061a1023fed58cbf20ff0d5d275127c0efb378 Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 20 Jun 2026 11:30:22 +0800 Subject: [PATCH 2/4] fix(release): exclude zod from inlined dependencies to resolve circular evaluation error --- scripts/build-npm.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build-npm.ts b/scripts/build-npm.ts index 71f43349..10f913eb 100644 --- a/scripts/build-npm.ts +++ b/scripts/build-npm.ts @@ -34,6 +34,7 @@ const commonExternal = [ '@temporalio/worker', '@temporalio/workflow', 'prisma', + 'zod', ] // Extract exact dependency versions from workspace From 982bca938378c3522318d7d0d24db6394ab98769 Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 20 Jun 2026 11:43:44 +0800 Subject: [PATCH 3/4] fix(release): resolve correct workspace dependency versions and refine CI smoke tests --- .github/workflows/ci.yaml | 12 +++---- packages/webui/components/user-menu.tsx | 20 +++++------ scripts/build-npm.ts | 45 ++++++++++++++++++++----- 3 files changed, 52 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 12f23936..a44bdc19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,21 +46,21 @@ jobs: - name: Test Local Release run: | bun run release:local --skip-check --out /tmp/shumai-local-release --force - + echo "Smoke testing shumai..." bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai/bin/shumai-app.js & PID1=$! sleep 3 - kill -0 $PID1 && kill $PID1 - + if kill -0 $PID1 2>/dev/null; then kill $PID1; else wait $PID1; fi + echo "Smoke testing shumai-agent..." bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-agent/bin/shumai-agent-app.js & PID2=$! sleep 3 - kill -0 $PID2 && kill $PID2 - + if kill -0 $PID2 2>/dev/null; then kill $PID2; else wait $PID2; fi + echo "Smoke testing shumai-transcode..." bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-transcode/bin/shumai-transcode-app.js & PID3=$! sleep 3 - kill -0 $PID3 && kill $PID3 + if kill -0 $PID3 2>/dev/null; then kill $PID3; else wait $PID3; fi diff --git a/packages/webui/components/user-menu.tsx b/packages/webui/components/user-menu.tsx index 0d02c0a9..d0275ea1 100644 --- a/packages/webui/components/user-menu.tsx +++ b/packages/webui/components/user-menu.tsx @@ -1,16 +1,16 @@ import { client } from '@/ui/api/client' import { Avatar, AvatarFallback, AvatarImage } from '@/ui/components/ui/avatar' import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuPortal, - DropdownMenuSeparator, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuPortal, + DropdownMenuSeparator, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuTrigger, } from '@/ui/components/ui/dropdown-menu' import { useTeamId } from '@/ui/hooks/use-team-id' import { signOut } from '@/ui/lib/auth-client' diff --git a/scripts/build-npm.ts b/scripts/build-npm.ts index 10f913eb..46f0296d 100644 --- a/scripts/build-npm.ts +++ b/scripts/build-npm.ts @@ -1,5 +1,5 @@ import tailwindPlugin from 'bun-plugin-tailwind' -import { existsSync } from 'node:fs' +import { existsSync, readFileSync, readdirSync } from 'node:fs' import { cp, mkdir, readdir, rm, writeFile } from 'node:fs/promises' import path from 'node:path' import { temporalWorkflow } from '../packages/workflow-core/src/bun-temporal-plugin' @@ -37,18 +37,45 @@ const commonExternal = [ 'zod', ] -// Extract exact dependency versions from workspace +// Extract exact dependency versions from workspace package.json files console.log('🔍 Extracting exact dependency versions for runtime packages...') -const lsOutput = Bun.spawnSync(['bun', 'pm', 'ls', '--all']).stdout.toString() const dependencyVersions: Record = {} +// Find all workspace package.json files +const packageJsonPaths = ['package.json'] +const workspaceDirs = ['packages', 'apps'] +for (const dir of workspaceDirs) { + if (existsSync(dir)) { + const subdirs = readdirSync(dir) + for (const subdir of subdirs) { + const p = path.join(dir, subdir, 'package.json') + if (existsSync(p)) { + packageJsonPaths.push(p) + } + } + } +} + for (const dep of commonExternal) { - const escapedDep = dep.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - const regex = new RegExp(`(?:^|\\s)${escapedDep}@(\\d+\\.\\d+\\.\\d+[^\\s]*)`, 'g') - const match = regex.exec(lsOutput) - if (match && match[1]) { - dependencyVersions[dep] = match[1] - console.log(` ✅ Found ${dep}@${match[1]}`) + let foundVersion: string | null = null + for (const p of packageJsonPaths) { + try { + const content = readFileSync(p, 'utf8') + const pkgJson = JSON.parse(content) + const version = pkgJson.dependencies?.[dep] || pkgJson.devDependencies?.[dep] + if (version) { + // Strip any leading range specifiers like ^ or ~ to get the base version + foundVersion = version.replace(/^[\^~]/, '') + break + } + } catch { + // ignore read/parse errors + } + } + + if (foundVersion) { + dependencyVersions[dep] = foundVersion + console.log(` ✅ Found ${dep}@${foundVersion}`) } else { console.warn(` ⚠️ Warning: Could not find exact version for ${dep}`) } From 292307e28ee42575a463c7d124c756ee9749b874 Mon Sep 17 00:00:00 2001 From: yiling Date: Sat, 20 Jun 2026 11:54:30 +0800 Subject: [PATCH 4/4] test(release): add check flag to app entrypoints and simplify CI smoke tests --- .github/workflows/ci.yaml | 15 +++------------ apps/agent/src/index.ts | 5 +++++ apps/transcode/src/index.ts | 5 +++++ apps/web/src/index.ts | 5 +++++ 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a44bdc19..4f3aff9b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,19 +48,10 @@ jobs: bun run release:local --skip-check --out /tmp/shumai-local-release --force echo "Smoke testing shumai..." - bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai/bin/shumai-app.js & - PID1=$! - sleep 3 - if kill -0 $PID1 2>/dev/null; then kill $PID1; else wait $PID1; fi + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai/bin/shumai-app.js --check echo "Smoke testing shumai-agent..." - bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-agent/bin/shumai-agent-app.js & - PID2=$! - sleep 3 - if kill -0 $PID2 2>/dev/null; then kill $PID2; else wait $PID2; fi + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-agent/bin/shumai-agent-app.js --check echo "Smoke testing shumai-transcode..." - bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-transcode/bin/shumai-transcode-app.js & - PID3=$! - sleep 3 - if kill -0 $PID3 2>/dev/null; then kill $PID3; else wait $PID3; fi + bun run /tmp/shumai-local-release/node/node_modules/@shumai-one/shumai-transcode/bin/shumai-transcode-app.js --check diff --git a/apps/agent/src/index.ts b/apps/agent/src/index.ts index fada3875..66dd1be9 100644 --- a/apps/agent/src/index.ts +++ b/apps/agent/src/index.ts @@ -5,6 +5,11 @@ import { workflowService } from '@shumai/workflow-core' import { TaskQueueAgent } from '@shumai/workflow-core' import { initAgentWorkflows } from '@shumai/agent' +if (process.argv.includes('--check')) { + console.log('✅ Agent worker evaluated successfully!') + process.exit(0) +} + async function run() { // Initialize workflows and activities initAgentWorkflows() diff --git a/apps/transcode/src/index.ts b/apps/transcode/src/index.ts index 5dba543c..915b3692 100644 --- a/apps/transcode/src/index.ts +++ b/apps/transcode/src/index.ts @@ -4,6 +4,11 @@ loadEnvConfig(process.cwd(), process.env.NODE_ENV !== 'production') import { initTranscodeWorkflows } from '@shumai/transcode' import { TaskQueueTranscode, workflowService } from '@shumai/workflow-core' +if (process.argv.includes('--check')) { + console.log('✅ Transcode worker evaluated successfully!') + process.exit(0) +} + async function run() { // Initialize workflows and activities initTranscodeWorkflows() diff --git a/apps/web/src/index.ts b/apps/web/src/index.ts index 05877b8c..d5860a94 100644 --- a/apps/web/src/index.ts +++ b/apps/web/src/index.ts @@ -11,6 +11,11 @@ import { initTranscodeWorkflows } from '@shumai/transcode' import { workflowService } from '@shumai/workflow-core' import { app } from '@shumai/api' +if (process.argv.includes('--check')) { + console.log('✅ Web app evaluated successfully!') + process.exit(0) +} + // Initialize workflows and activities for local executor mode initAgentWorkflows() initTranscodeWorkflows()