fix(release): resolve correct workspace dependency versions and refine CI smoke tests

This commit is contained in:
yiling
2026-06-20 11:43:44 +08:00
parent d1061a1023
commit 982bca9383
3 changed files with 52 additions and 25 deletions
+6 -6
View File
@@ -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
+10 -10
View File
@@ -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'
+36 -9
View File
@@ -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<string, string> = {}
// 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}`)
}