Releases were built and signed in CI, which meant AMO credentials had to live on the runner. Move the whole flow local: builds and Firefox signing happen on the maintainer's machine and only the finished artifacts are published. Add `ext:pack:firefox` and `ext:pack:chrome` (production builds; the Firefox one is signed via `web-ext sign` unlisted with credentials read from the GNOME Keyring through `secret-tool`, the Chrome one is zipped) and wire them to the `version` lifecycle: - `preversion` runs lint and tests. - `version` builds and signs into `web-ext-artifacts/`. - `postversion` pushes the bump commit and tag, then uploads both artifacts to the Gitea release and publishes it if still a draft. Switch the plain `ext:build:*` scripts to production and add `ext:build:dev:*` for development builds; `ext:dev` is unchanged. The build manifest now takes its version from package.json and drops the "(dev)" name suffix when `DASHTAB_RELEASE=1`. Because packaging needs a production build, relax the AGENTS.md production-build restriction to allow it for packaging and releasing.
33 lines
1019 B
JavaScript
33 lines
1019 B
JavaScript
#!/usr/bin/env node
|
|
// Packages the built Chrome/Brave extension into a zip for the release page.
|
|
// The Chrome build has no signing step (it is loaded unpacked), so this just
|
|
// archives the built directory.
|
|
import { spawnSync } from 'node:child_process';
|
|
import { dirname, join } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
const repoRoot = join(dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
const sourceDir = join(repoRoot, 'extension', 'build', 'chrome');
|
|
const artifactsDir = join(repoRoot, 'web-ext-artifacts');
|
|
const webExt = join(repoRoot, 'node_modules', '.bin', 'web-ext');
|
|
|
|
// The test suite is a dev-only artifact; keep it out of the packaged extension.
|
|
const ignoreFiles = ['tests/**', 'testem.js', 'assets/tests-*'];
|
|
|
|
const result = spawnSync(
|
|
webExt,
|
|
[
|
|
'build',
|
|
'--source-dir',
|
|
sourceDir,
|
|
'--artifacts-dir',
|
|
artifactsDir,
|
|
'--overwrite-dest',
|
|
'--ignore-files',
|
|
...ignoreFiles,
|
|
],
|
|
{ stdio: 'inherit' },
|
|
);
|
|
|
|
process.exit(result.status ?? 1);
|