Skip to content

Commit 2051495

Browse files
committed
fix(CI): verdaccio publish for Node20
1 parent 2c03834 commit 2051495

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

util/local_verdaccio_publish

+24-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ const verdaccio = spawn('npx', ['verdaccio', '-c', 'verdaccio/config.yaml'], pip
2222
.on('error', e => {
2323
throw e
2424
})
25+
.on('close', (code, signal) => {
26+
console.log(`verdaccio process closed with code ${code} or signal ${signal}`);
27+
})
28+
.on('exit', (code, signal) => {
29+
console.log(`verdaccio process exited with code ${code} or signal ${signal}`);
30+
})
2531

2632
// Publish all changed packages the local verdaccio server.
2733
// Anything that has not been changed will match what is in npm
@@ -35,21 +41,33 @@ const args = [
3541
'--no-git-reset',
3642
'--preid', 'ci',
3743
'--no-verify-access',
38-
'--force-publish'
44+
'--force-publish',
45+
'--loglevel', 'warn',
46+
'--no-progress'
3947
]
40-
spawn('npx', args, pipeStdIo)
41-
.on('close', (code) => {
48+
timeout = 60000 * 2
49+
console.log(`Starting lerna publish with timeout of ${timeout}`);
50+
spawn('npx', args, {
51+
stdio: [process.stdin, process.stdout, process.stderr],
52+
timeout: timeout
53+
}).on('close', (code, signal) => {
54+
console.log(`lerna terminated due to receipt of signal ${signal} or code ${code}`);
4255
// The above command will make some modifications,
4356
// Roll them back
4457
// Ideally, we would find a way to not have to do this
4558
execSync('git checkout -- modules/**/package.json')
4659
execSync('git checkout -- lerna.json')
60+
execSync('git restore package-lock.json')
4761

4862
// Kill the background verdaccio server
49-
verdaccio.kill()
50-
63+
verdaccioKilledStatus = verdaccio.kill()
64+
console.log(`killing Verdaccio returned ${verdaccioKilledStatus}`);
65+
5166
// If this command had an error,
5267
// we need to forward this.
5368
// Otherwise the entire CI build may think that things succeeded.
5469
if (code !== 0) throw Error(`Exit code: ${code}`)
55-
})
70+
71+
process.exit()
72+
})
73+

0 commit comments

Comments
 (0)