add builder and updater

This commit is contained in:
Joey Kimsey
2026-09-12 21:21:28 -04:00
parent 6e42b1012d
commit 1ee2774241
24 changed files with 4115 additions and 10 deletions

15
scripts/publish.mjs Normal file
View File

@ -0,0 +1,15 @@
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')
console.log(`Capsule ${release.version}: ${release.feedUrl}`)
if (!args.includes('--upload')) {
console.log('Verified. Upload order:')
for (const file of release.files) console.log(` ${file.name} (${file.data.length} bytes)`)
console.log('No files uploaded. Add --upload with CAPSULE_UPLOAD_URL and CAPSULE_UPLOAD_TOKEN to publish.')
} else {
// This adapter targets an authenticated HTTPS PUT/WebDAV endpoint, not any TTP site API.
await uploadRelease(release, { uploadUrl: process.env.CAPSULE_UPLOAD_URL, token: process.env.CAPSULE_UPLOAD_TOKEN })
}