mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-11 17:29:03 +02:00
electron-builder refuses a non-semver package.json version, so the published number lives in package.json releaseVersion and scripts/dist.mjs passes it as extraMetadata.version (plus the hotfix digit as Windows build number). The workflow tags and names the release from the same field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Wn5VX9HNbJ7N54hR24u9Y
17 lines
854 B
JavaScript
17 lines
854 B
JavaScript
// Packages the app with electron-builder using the four-part release version
|
|
// (package.json "releaseVersion", e.g. 2.0.0.1). package.json "version" must stay semver.
|
|
import { spawnSync } from 'node:child_process';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
|
|
const release = pkg.releaseVersion || pkg.version;
|
|
const build = release.split('.')[3] ?? '0';
|
|
const args = process.argv.slice(2);
|
|
if (!args.some((a) => a.startsWith('--win') || a.startsWith('--linux') || a.startsWith('--mac'))) args.unshift('--win');
|
|
const result = spawnSync('npx', ['electron-builder', ...args, `--config.extraMetadata.version=${release}`], {
|
|
stdio: 'inherit',
|
|
shell: process.platform === 'win32',
|
|
env: { ...process.env, BUILD_NUMBER: process.env.BUILD_NUMBER ?? build }
|
|
});
|
|
process.exit(result.status ?? 1);
|