release-firefox.ts

2.8 KB · raw

1#!/usr/bin/env bun2// scripts/release-firefox.ts3// One-command Firefox AMO release.4// Usage: bun run scripts/release-firefox.ts5//6// Required environment variables:7//   AMO_JWT_ISSUER, AMO_JWT_SECRET8//9// PB-26-211: all tools are resolved from node_modules/.bin — run10// `bun install --frozen-lockfile` before invoking release.1112import {13  preflight,14  readVersion,15  runCommand,16  safeEnv,17  releaseGateEnv,18  packageSourceArchive,19  signFirefox,20} from "./release-lib";2122// ─── Preflight ───────────────────────────────────────────────────────────────2324preflight();25const version = readVersion("manifest.firefox.json");26console.log(`\n🍑 Peach Firefox — releasing v${version}`);2728// ─── CI gate ───────────────────────────────────────────────────────────────────29// PEACH_RELEASE_BROWSER_GATE=1 is injected by releaseGateEnv for this child.30// PB-26-211: CI runs with a minimal safe environment — no store credentials.3132runCommand("npm", ["run", "ci"], {33  label: "Running CI gate",34  env: releaseGateEnv(),35});3637// ─── Build ─────────────────────────────────────────────────────────────────────3839runCommand("npm", ["run", "build:firefox"], {40  label: `Building Firefox extension v${version}`,41  env: safeEnv(),42});4344// ─── Package source archive ────────────────────────────────────────────────────45// AMO requires source for any extension with minified/transpiled code.46// This zips everything a reviewer needs to build Peach from source.4748const sourceZip = packageSourceArchive(version);4950// ─── Sign and submit ───────────────────────────────────────────────────────────51// PB-26-211: AMO credentials are read and validated here, immediately before52// signing. They are passed only to the web-ext child.5354signFirefox(sourceZip);5556// ─── Done ──────────────────────────────────────────────────────────────────────5758console.log(`\n✓ Peach Firefox v${version} submitted to AMO.`);59console.log(`  Source archive retained at ${sourceZip}.`);60console.log("  Existing users will receive the update automatically.");61console.log("  Check AMO developer hub for review status.");62console.log("");