Enable isolated Capsule Local automatic update testing
This commit is contained in:
@ -2,8 +2,13 @@ import { verifyRelease } from './releaseArtifacts.mjs'
|
||||
import { uploadRelease } from './uploadRelease.mjs'
|
||||
|
||||
const args = process.argv.slice(2)
|
||||
if (args.some((arg) => arg !== '--upload')) throw new Error('Usage: npm run publish:release -- [--upload]')
|
||||
const release = await verifyRelease('dist/release')
|
||||
if (args.some((arg) => !['--upload', '--test-updates'].includes(arg))) throw new Error('Usage: npm run publish:release -- [--test-updates] [--upload]')
|
||||
const testing = args.includes('--test-updates')
|
||||
const release = await verifyRelease(testing ? 'dist/test' : 'dist/release')
|
||||
if (testing && (!new URL(release.feedUrl).pathname.endsWith('/capsule/testfeed/') ||
|
||||
(args.includes('--upload') && !new URL(process.env.CAPSULE_UPLOAD_URL).pathname.endsWith('/capsule/testupload/')))) {
|
||||
throw new Error('Test publication requires the separate testfeed and testupload endpoints.')
|
||||
}
|
||||
console.log(`Capsule ${release.version}: ${release.feedUrl}`)
|
||||
if (!args.includes('--upload')) {
|
||||
console.log('Verified. Upload order:')
|
||||
|
||||
Reference in New Issue
Block a user