feat: separate Chinese display name and English packaging name
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
15
.github/scripts/prepare-template.mjs
vendored
15
.github/scripts/prepare-template.mjs
vendored
@@ -7,11 +7,14 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const root = path.resolve(__dirname, "../..");
|
||||
|
||||
const jobId = process.env.JOB_ID;
|
||||
const appName = process.env.APP_NAME;
|
||||
const appNameZh = process.env.APP_NAME;
|
||||
const appNameEn = process.env.APP_NAME_EN;
|
||||
const appIdentifier = process.env.APP_IDENTIFIER;
|
||||
|
||||
if (!jobId || !appName || !appIdentifier) {
|
||||
console.error("JOB_ID, APP_NAME, and APP_IDENTIFIER are required");
|
||||
if (!jobId || !appNameZh || !appNameEn || !appIdentifier) {
|
||||
console.error(
|
||||
"JOB_ID, APP_NAME, APP_NAME_EN, and APP_IDENTIFIER are required",
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -49,13 +52,13 @@ function toSafeBinaryName(name, fallback) {
|
||||
|
||||
function patchTauriConfig(filePath) {
|
||||
const conf = JSON.parse(fs.readFileSync(filePath, "utf8"));
|
||||
const safeBinaryName = toSafeBinaryName(appName, `App${jobId}`);
|
||||
conf.productName = appName;
|
||||
const safeBinaryName = toSafeBinaryName(appNameEn, `App${jobId}`);
|
||||
conf.productName = appNameZh;
|
||||
conf.mainBinaryName = safeBinaryName;
|
||||
conf.identifier = appIdentifier;
|
||||
conf.version = "1.0.0";
|
||||
if (conf.app?.windows?.[0]) {
|
||||
conf.app.windows[0].title = appName;
|
||||
conf.app.windows[0].title = appNameZh;
|
||||
}
|
||||
fs.writeFileSync(filePath, `${JSON.stringify(conf, null, 2)}\n`);
|
||||
}
|
||||
|
||||
9
.github/workflows/build-app.yml
vendored
9
.github/workflows/build-app.yml
vendored
@@ -8,7 +8,11 @@ on:
|
||||
required: true
|
||||
type: string
|
||||
app_name:
|
||||
description: Application display name
|
||||
description: Application display name (Chinese)
|
||||
required: true
|
||||
type: string
|
||||
app_name_en:
|
||||
description: Application English name for packaging
|
||||
required: true
|
||||
type: string
|
||||
app_identifier:
|
||||
@@ -22,6 +26,7 @@ permissions:
|
||||
env:
|
||||
JOB_ID: ${{ inputs.job_id }}
|
||||
APP_NAME: ${{ inputs.app_name }}
|
||||
APP_NAME_EN: ${{ inputs.app_name_en }}
|
||||
APP_IDENTIFIER: ${{ inputs.app_identifier }}
|
||||
NDK_VERSION: "27.2.12479018"
|
||||
|
||||
@@ -168,7 +173,7 @@ jobs:
|
||||
tag_name: build-${{ inputs.job_id }}
|
||||
name: Web2App ${{ inputs.app_name }} (${{ inputs.job_id }})
|
||||
body: |
|
||||
Automated build for **${{ inputs.app_name }}** (`${{ inputs.app_identifier }}`).
|
||||
Automated build for **${{ inputs.app_name }}** (English: `${{ inputs.app_name_en }}`, ID: `${{ inputs.app_identifier }}`).
|
||||
|
||||
- Windows desktop installer/portable binary
|
||||
- Android APK (demo signing, sideload only)
|
||||
|
||||
Reference in New Issue
Block a user