feat: release OpsXShell 2.1.0 native Tauri edition
This commit is contained in:
1 parent
e9a0d21758
commit
a3dba0c6ed
311 files changed
+31748
-14897
No files matched your search
@@ -0,0 +1,57 @@
|
||||
import { existsSync } from 'node:fs'
|
||||
import { homedir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
|
||||
const mode = process.argv[2] ?? 'quick'
|
||||
if (!['quick', 'full'].includes(mode)) {
|
||||
console.error(`Unknown acceptance mode: ${mode}`)
|
||||
process.exit(2)
|
||||
}
|
||||
|
||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
||||
const cargoHomeBinary = join(homedir(), '.cargo', 'bin', process.platform === 'win32' ? 'cargo.exe' : 'cargo')
|
||||
const cargo = process.env.CARGO || (existsSync(cargoHomeBinary) ? cargoHomeBinary : 'cargo')
|
||||
const manifest = 'src-tauri/Cargo.toml'
|
||||
|
||||
const quickSteps = [
|
||||
['Renderer type contract', npm, ['run', 'typecheck:ui']],
|
||||
['Test and mock contracts', npm, ['run', 'typecheck:test']],
|
||||
['Unit and foundation smoke tests', npm, ['test']],
|
||||
['Rust formatting', cargo, ['fmt', '--manifest-path', manifest, '--', '--check']],
|
||||
['Rust compile check', cargo, ['check', '--manifest-path', manifest]],
|
||||
]
|
||||
|
||||
const fullSteps = [
|
||||
['TypeScript and React lint', npm, ['run', 'lint']],
|
||||
...quickSteps,
|
||||
['Rust lint with warnings denied', cargo, ['clippy', '--manifest-path', manifest, '--all-targets', '--', '-D', 'warnings']],
|
||||
['Rust tests', cargo, ['test', '--manifest-path', manifest]],
|
||||
['Renderer production build', npm, ['run', 'build:ui']],
|
||||
['Release tooling tests', npm, ['run', 'test:release']],
|
||||
]
|
||||
|
||||
const steps = mode === 'full' ? fullSteps : quickSteps
|
||||
const startedAt = Date.now()
|
||||
|
||||
for (const [label, command, args] of steps) {
|
||||
console.log(`\n[acceptance] ${label}`)
|
||||
const result = spawnSync(command, args, {
|
||||
cwd: process.cwd(),
|
||||
env: process.env,
|
||||
stdio: 'inherit',
|
||||
})
|
||||
|
||||
if (result.error) {
|
||||
console.error(`[acceptance] Unable to run ${command}: ${result.error.message}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
if (result.status !== 0) {
|
||||
console.error(`[acceptance] FAILED: ${label}`)
|
||||
process.exit(result.status ?? 1)
|
||||
}
|
||||
}
|
||||
|
||||
const elapsedSeconds = ((Date.now() - startedAt) / 1000).toFixed(1)
|
||||
console.log(`\n[acceptance] PASS (${mode}, ${elapsedSeconds}s)`)
|
||||
Reference in new issue
Block a user