Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

refactor(release): single-source app version, drop dead tauri.conf path

yhh7720aab7d2d0
diff --git a/build-tools/release.js b/build-tools/release.js
index e261e1d06..7dea3353f 100644
--- a/build-tools/release.js
+++ b/build-tools/release.js
@@ -6,7 +6,9 @@ import { readFileSync, writeFileSync } from 'fs';
import { execSync } from 'child_process';
import chalk from 'chalk';
-const TAURI_CONF = 'desktop/src-tauri/tauri.conf.json';
+// desktop/package.json is the single source of the desktop app version:
+// electron-builder reads it, and the git tag mirrors it.
+const PKG = 'desktop/package.json';
function run(cmd) {
console.log(chalk.gray(` $ ${cmd}`));
@@ -25,7 +27,7 @@ function die(msg) {
const version = process.argv[2];
if (!version) {
console.log(`Usage: node build-tools/release.js <version>`);
- console.log(` e.g. node build-tools/release.js 0.4.3`);
+ console.log(` e.g. node build-tools/release.js 0.14.1`);
process.exit(1);
}
@@ -40,16 +42,22 @@ if (status) {
console.log(chalk.bold.white(`\n═══ Release v${version} ═══\n`));
-console.log(chalk.cyan('▸'), `Updating ${TAURI_CONF} to ${version}`);
-const conf = JSON.parse(readFileSync(TAURI_CONF, 'utf8'));
-const oldVersion = conf.version;
+// Soft reminder: the release should already be documented before we tag it.
+const changelog = readFileSync('CHANGELOG.md', 'utf8');
+if (!changelog.includes(`## [${version}]`)) {
+ console.log(chalk.yellow('⚠'), `CHANGELOG.md has no "## [${version}]" entry — add release notes before publishing.`);
+}
+
+console.log(chalk.cyan('▸'), `Updating ${PKG} to ${version}`);
+const pkg = JSON.parse(readFileSync(PKG, 'utf8'));
+const oldVersion = pkg.version;
if (oldVersion === version) {
console.log(chalk.yellow('⚠'), `Version already ${version}, skipping file update`);
} else {
- conf.version = version;
- writeFileSync(TAURI_CONF, JSON.stringify(conf, null, 2) + '\n');
- run(`git add ${TAURI_CONF}`);
- run(`git commit -m "chore: bump desktop version to ${version}"`);
+ pkg.version = version;
+ writeFileSync(PKG, JSON.stringify(pkg, null, 2) + '\n');
+ run(`git add ${PKG}`);
+ run(`git commit -m "chore: release v${version}"`);
}
console.log(chalk.cyan('▸'), `Creating tag v${version}`);
diff --git a/desktop/package.json b/desktop/package.json
index 966ea05f2..bd49c9c9b 100644
--- a/desktop/package.json
+++ b/desktop/package.json
@@ -1,6 +1,6 @@
{
"name": "@estella/editor",
- "version": "0.0.1",
+ "version": "0.14.0",
"private": true,
"license": "Apache-2.0",
"description": "Estella Editor — visual scene editor for the Estella 2D WASM engine",
diff --git a/package.json b/package.json
index 8a4dc589a..4cf54809a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,5 @@
{
"name": "esengine",
- "version": "0.3.0",
"private": true,
"type": "module",
"description": "Estella - A fast 2D game engine powered by WebAssembly and ECS",