Skip to content

Commit 3cbf226

Browse files
committed
chore(scripts): reorder ci-validate and correct bump release hint
- ci-validate: build first, then check, then test --skip-build, so later steps exercise fresh artifacts without a redundant rebuild. - bump: printFooter hint now points to \`pnpm release\` (the actual publish script), not \`pnpm publish\`.
1 parent ea3c043 commit 3cbf226

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

scripts/bump.mts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import type { Logger } from '@socketsecurity/lib/logger'
1818
import { getDefaultLogger } from '@socketsecurity/lib/logger'
1919
import type { SpawnOptions, SpawnResult } from '@socketsecurity/lib/spawn'
2020
import { spawn } from '@socketsecurity/lib/spawn'
21-
import { printFooter, printHeader } from '@socketsecurity/lib/stdio/header'
21+
import { printFooter } from '@socketsecurity/lib/stdio/footer'
22+
import { printHeader } from '@socketsecurity/lib/stdio/header'
2223

2324
type CommandResult = {
2425
exitCode: number
@@ -919,7 +920,7 @@ async function main(): Promise<void> {
919920
printFooter(`Version bumped to ${newVersion}!`)
920921

921922
logger.info('\nNext steps:')
922-
logger.substep('1. Run `pnpm publish` to publish to npm')
923+
logger.substep('1. Run `pnpm release` to publish to npm')
923924
logger.substep('2. Create GitHub release if needed')
924925

925926
process.exitCode = 0

scripts/ci-validate.mts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ async function main(): Promise<void> {
4444
try {
4545
printHeader('CI Validation')
4646

47-
// Run tests
48-
logger.step('Running tests')
49-
let exitCode: number = await runCommand('pnpm', ['test', '--all'])
47+
// Run build first so test/check operate on fresh artifacts.
48+
logger.step('Building project')
49+
let exitCode: number = await runCommand('pnpm', ['build'])
5050
if (exitCode !== 0) {
51-
logger.error('Tests failed')
51+
logger.error('Build failed')
5252
process.exitCode = exitCode
5353
return
5454
}
55-
logger.success('Tests passed')
55+
logger.success('Build completed')
5656

57-
// Run checks
57+
// Run checks against the built artifacts.
5858
logger.step('Running checks')
5959
exitCode = await runCommand('pnpm', ['check', '--all'])
6060
if (exitCode !== 0) {
@@ -64,15 +64,15 @@ async function main(): Promise<void> {
6464
}
6565
logger.success('Checks passed')
6666

67-
// Run build
68-
logger.step('Building project')
69-
exitCode = await runCommand('pnpm', ['build'])
67+
// Run tests last; skip redundant build since we already built above.
68+
logger.step('Running tests')
69+
exitCode = await runCommand('pnpm', ['test', '--all', '--skip-build'])
7070
if (exitCode !== 0) {
71-
logger.error('Build failed')
71+
logger.error('Tests failed')
7272
process.exitCode = exitCode
7373
return
7474
}
75-
logger.success('Build completed')
75+
logger.success('Tests passed')
7676

7777
logger.success('CI validation completed successfully!')
7878
} catch (e) {

0 commit comments

Comments
 (0)