mirror of
https://github.com/R0m1k3/EveFlow.git
synced 2026-10-12 01:39:13 +02:00
build: four-part releaseVersion (2.0.0.1) injected at packaging time
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
This commit is contained in:
4 files changed
+23
-6
No files matched your search
@@ -0,0 +1,16 @@
|
||||
// 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);
|
||||
Reference in new issue
Block a user