diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 5d5db5ce..a624e04b 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -6,8 +6,8 @@ on: workflow_dispatch: inputs: version: - description: Version without the android-v prefix - required: true + description: Version without the android-v prefix; defaults to package.json + required: false type: string prerelease: description: Publish as a prerelease @@ -53,8 +53,8 @@ jobs: version="${GITHUB_REF_NAME#android-v}" tag="$GITHUB_REF_NAME" else - version="$INPUT_VERSION" - tag="android-v${INPUT_VERSION}" + version="${INPUT_VERSION:-$(node -p "require('./package.json').version")}" + tag="android-v${version}" fi [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+([.-][0-9A-Za-z.-]+)?$ ]] echo "version=$version" >> "$GITHUB_OUTPUT" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..87f65a88 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,32 @@ +# Changelog + +EdgeChat 从 `2.1.2` 起正式采用语义化版本。更早的版本号依据已经完成的主要里程碑补记,用于说明项目演进,不对应历史 Git 标签。 + +## 2.1.2 - 2026-09-08 + +- 统一 Web、安装维护页、demo 与 Capacitor 客户端的项目版本来源。 +- 完成安装维护自检、Cloudflare 资源隔离与二代客户端发布后的稳定性整理。 + +## 2.1.1 - 2026-09-06 + +- 隔离并精确复用 Cloudflare KV 会话命名空间,完善双账户部署校验。 + +## 2.1.0 - 2026-09-05 + +- 新增网页安装与维护自检、D1 迁移账本校验和诊断报告。 + +## 2.0.0 - 2026-09-05 + +- 以复用 Vue 界面的 Capacitor 客户端作为主要 Android 发行版,进入第二代产品线。 + +## 1.2.0 - 2026-09-04 + +- 完成群聊提及、语音消息与 Telegram 风格消息回复。 + +## 1.1.0 - 2026-08-31 + +- 增加 Telegram 双向同步、移动 API v1 与首版 Android 客户端。 + +## 1.0.0 - 2026-04-05 + +- 建立 EdgeChat 的 Cloudflare Worker、D1、KV、R2 与 Vue Web 基础版本。 diff --git a/capacitor/android/app/build.gradle b/capacitor/android/app/build.gradle index 1aa21d4e..3c25291e 100644 --- a/capacitor/android/app/build.gradle +++ b/capacitor/android/app/build.gradle @@ -1,3 +1,5 @@ +import groovy.json.JsonSlurper + apply plugin: 'com.android.application' apply plugin: 'kotlin-android' @@ -7,7 +9,7 @@ if (signingPropertiesFile.exists()) { signingPropertiesFile.withInputStream { signingProperties.load(it) } } def edgechatVersionCode = (project.findProperty('edgechatVersionCode') ?: '1').toInteger() -def edgechatVersionName = project.findProperty('edgechatVersionName') ?: '0.1.0' +def edgechatVersionName = project.findProperty('edgechatVersionName') ?: new JsonSlurper().parse(rootProject.file('../../package.json')).version android { namespace = "com.aozorae.edgechat.web" diff --git a/package-lock.json b/package-lock.json index 1ce6c57e..f3e29f30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "edgechat", - "version": "1.0.0", + "version": "2.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "edgechat", - "version": "1.0.0", + "version": "2.1.2", "dependencies": { "@capacitor/android": "^8.5.1", "@capacitor/core": "^8.5.1", diff --git a/package.json b/package.json index cbfb6fcb..5bebbfda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "edgechat", - "version": "1.0.0", + "version": "2.1.2", "private": true, "type": "module", "scripts": { diff --git a/test/android-workflows.test.js b/test/android-workflows.test.js index 415c0c40..6eb8fbaf 100644 --- a/test/android-workflows.test.js +++ b/test/android-workflows.test.js @@ -29,6 +29,7 @@ test("Android release signs and publishes the primary Capacitor client", () => { assert.match(release, /node-version: "24"/); assert.match(release, /java-version: "21"/); assert.match(release, /npm run capacitor:sync/); + assert.match(release, /require\('\.\/package\.json'\)\.version/); assert.match(release, /assembleDebugAndroidTest/); assert.match(release, /:app:assembleRelease :app:bundleRelease/); assert.match(release, /capacitor\/android\/app\/build\/outputs\/apk\/release/); diff --git a/test/capacitor-android.test.js b/test/capacitor-android.test.js index 287451a0..bd63ddfb 100644 --- a/test/capacitor-android.test.js +++ b/test/capacitor-android.test.js @@ -41,6 +41,7 @@ test("login submission reads the values currently displayed by Android WebView", test("Capacitor Android CI builds an independent tested APK", () => { const workflow = read("../.github/workflows/capacitor-android-ci.yml"); const gradleRunner = read("../capacitor/scripts/run-gradle.mjs"); + const appBuild = read("../capacitor/android/app/build.gradle"); const viteConfig = read("../frontend/vite.capacitor.config.js"); assert.match(workflow, /actions\/setup-node@v5/); assert.match(workflow, /node-version: "24"/); @@ -60,6 +61,7 @@ test("Capacitor Android CI builds an independent tested APK", () => { assert.match(gradleRunner, new RegExp(task.replaceAll(":", "\\:"))); } assert.match(gradleRunner, /-Dorg\.gradle\.java\.home=/); + assert.match(appBuild, /rootProject\.file\('\.\.\/\.\.\/package\.json'\)/); assert.match(viteConfig, /target: 'es2020'/); }); diff --git a/test/schema-contract.test.js b/test/schema-contract.test.js index e6dae8b0..1a3eb0f1 100644 --- a/test/schema-contract.test.js +++ b/test/schema-contract.test.js @@ -30,11 +30,13 @@ test("deployment and runtime inspect only application tables, never protected D1 test("manifest is generated from executable SQLite schema and includes future tables/columns/indexes/triggers", async () => { const manifest = await generateSchemaManifest(); + const project = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")); const schema = readFileSync(new URL("../worker/schema.sql", import.meta.url), "utf8").replaceAll("\r\n", "\n").replaceAll("\r", "\n"); const db = new SQL.Database(); db.exec(schema); db.exec("CREATE TABLE future_probe (id INTEGER PRIMARY KEY, label TEXT); CREATE INDEX future_probe_label ON future_probe(label); CREATE TRIGGER future_probe_trigger AFTER INSERT ON future_probe BEGIN SELECT 1; END;"); const artifacts = await collectSchemaArtifacts(async (sql) => rows(db, sql)); + assert.equal(manifest.version, project.version); assert.ok(manifest.artifacts.includes("table:users")); assert.ok(artifacts.has("table:future_probe")); assert.ok(artifacts.has("column:future_probe.label")); @@ -140,8 +142,10 @@ test("schema contract identifies missing ledger, migration, ahead, and checksum test("demo maintenance report uses the generated manifest and matches the production check ids", () => { const report = demoMaintenanceReport(); + const project = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")); assert.equal(report.demo, true); assert.equal(report.status, "ok"); + assert.equal(report.version, `v${project.version}`); assert.equal(report.expectedMigration, D1_MIGRATIONS.at(-1).id); assert.deepEqual(report.checks.map((check) => check.id), ["d1", "schema", "sessions", "files", "channelRoom", "userInbox", "scheduler", "environment"]); assert.equal(report.checks.find((check) => check.id === "schema").schema.status, "ok");