()
| 250 | }; |
| 251 | |
| 252 | const main = async () => { |
| 253 | const options = parseArgs(process.argv.slice(2)); |
| 254 | const version = await readVersion(); |
| 255 | const tag = `v${version}`; |
| 256 | const refTag = resolveTagFromEnvironment(); |
| 257 | const channel = resolveChannel(version); |
| 258 | |
| 259 | validateVersion(version); |
| 260 | |
| 261 | if (refTag && refTag !== tag) { |
| 262 | throw new Error(`GitHub tag ${refTag} does not match ${versionPackagePath} version ${version}`); |
| 263 | } |
| 264 | |
| 265 | await rm(releaseDir, { recursive: true, force: true }); |
| 266 | await mkdir(releaseDir, { recursive: true }); |
| 267 | |
| 268 | await runCommand({ |
| 269 | command: "bun", |
| 270 | args: ["run", "src/build.ts", "binary"], |
| 271 | cwd: cliRoot, |
| 272 | }); |
| 273 | |
| 274 | await runCommand({ |
| 275 | command: "bun", |
| 276 | args: ["run", "src/build.ts", "release-assets"], |
| 277 | cwd: cliRoot, |
| 278 | }); |
| 279 | |
| 280 | const wrapperArchivePath = await packWrapperPackage(); |
| 281 | const assetPaths = await collectReleaseAssetPaths(wrapperArchivePath); |
| 282 | |
| 283 | console.log(`Prepared executor@${version} for ${channel}`); |
| 284 | for (const assetPath of assetPaths) { |
| 285 | console.log(`- ${assetPath}`); |
| 286 | } |
| 287 | |
| 288 | if (options.dryRun) { |
| 289 | return; |
| 290 | } |
| 291 | |
| 292 | await syncGitHubRelease({ |
| 293 | tag, |
| 294 | channel, |
| 295 | assetPaths, |
| 296 | }); |
| 297 | |
| 298 | await runCommand({ |
| 299 | command: "bun", |
| 300 | args: ["run", "src/build.ts", "publish", channel], |
| 301 | cwd: cliRoot, |
| 302 | }); |
| 303 | }; |
| 304 | |
| 305 | await main(); |
no test coverage detected