mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-18 19:16:22 +00:00
- Extend scripts/build/cli/upload.ts with uploadCliRelease() that pushes
archives + checksums to R2 under versioned (cli/v{VERSION}/) and latest
(cli/latest/) paths, plus a version.txt for lightweight latest resolution
- Update scripts/build/cli.ts entry point with --release/--version/--binaries-dir
flags (existing no-args behavior preserved for upload:cli-installers)
- Rewrite install.sh and install.ps1 to fetch from cdn.browseros.com instead of
GitHub releases API — eliminates rate limits and API dependency
- Add environment: release-core to release-cli.yml for core-team gating via
GitHub environment protection rules
- Add Bun setup + CDN upload step to the workflow between build and GitHub release
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
#!/usr/bin/env bun
|
|
|
|
import { Command } from 'commander'
|
|
|
|
import { runCliInstallerUpload, runCliRelease } from './cli/upload'
|
|
|
|
const program = new Command('cli-upload')
|
|
.description('Upload BrowserOS CLI artifacts to CDN')
|
|
.option(
|
|
'--release',
|
|
'Upload full release (binaries + installers + version.txt)',
|
|
)
|
|
.option('--version <version>', 'Release version (required with --release)')
|
|
.option(
|
|
'--binaries-dir <dir>',
|
|
'Directory containing built archives (required with --release)',
|
|
)
|
|
.parse()
|
|
|
|
const opts = program.opts<{
|
|
release?: boolean
|
|
version?: string
|
|
binariesDir?: string
|
|
}>()
|
|
|
|
async function main(): Promise<void> {
|
|
if (opts.release) {
|
|
if (!opts.version) {
|
|
throw new Error('--version is required with --release')
|
|
}
|
|
if (!opts.binariesDir) {
|
|
throw new Error('--binaries-dir is required with --release')
|
|
}
|
|
await runCliRelease({
|
|
version: opts.version,
|
|
binariesDir: opts.binariesDir,
|
|
})
|
|
} else {
|
|
await runCliInstallerUpload()
|
|
}
|
|
}
|
|
|
|
main().catch((error) => {
|
|
const message = error instanceof Error ? error.message : String(error)
|
|
console.error(`\n✗ ${message}\n`)
|
|
process.exit(1)
|
|
})
|