v1.1
This commit is contained in:
@@ -218,10 +218,10 @@ if os.path.exists(gradle_path):
|
|||||||
with open(gradle_path, "r", encoding="utf-8") as f:
|
with open(gradle_path, "r", encoding="utf-8") as f:
|
||||||
gradle = f.read()
|
gradle = f.read()
|
||||||
|
|
||||||
# 替换 versionCode(形如 "versionCode 1" 或 "versionCode 10000")
|
# 替换 versionCode(适配 Capacitor 8 / Gradle 8 的 "=" 赋值语法)
|
||||||
gradle = re.sub(r"versionCode\s+\d+", f"versionCode {version_code}", gradle)
|
gradle = re.sub(r"versionCode(?:\s*=\s*|\s+)\d+", f"versionCode = {version_code}", gradle)
|
||||||
# 替换 versionName(形如 versionName "1.0")
|
# 替换 versionName
|
||||||
gradle = re.sub(r'versionName\s+"[^"]+"', f'versionName "{version_name}"', gradle)
|
gradle = re.sub(r'versionName(?:\s*=\s*|\s+)"[^"]+"', f'versionName = "{version_name}"', gradle)
|
||||||
|
|
||||||
with open(gradle_path, "w", encoding="utf-8") as f:
|
with open(gradle_path, "w", encoding="utf-8") as f:
|
||||||
f.write(gradle)
|
f.write(gradle)
|
||||||
|
|||||||
@@ -27,18 +27,18 @@ jobs:
|
|||||||
name: Build EmbyX-zh APK
|
name: Build EmbyX-zh APK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup JDK 17
|
- name: Setup JDK 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '21'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 22
|
||||||
|
|
||||||
# 动态生成中文版 capacitor.config.json(webDir 指向 zh/ 目录)
|
# 动态生成中文版 capacitor.config.json(webDir 指向 zh/ 目录)
|
||||||
- name: Create capacitor.config.json (zh)
|
- name: Create capacitor.config.json (zh)
|
||||||
@@ -85,7 +85,7 @@ jobs:
|
|||||||
run: mv android/app/build/outputs/apk/debug/app-debug.apk EmbyX-zh.apk
|
run: mv android/app/build/outputs/apk/debug/app-debug.apk EmbyX-zh.apk
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: embyx-zh
|
name: embyx-zh
|
||||||
path: EmbyX-zh.apk
|
path: EmbyX-zh.apk
|
||||||
@@ -95,18 +95,18 @@ jobs:
|
|||||||
name: Build EmbyX-en APK
|
name: Build EmbyX-en APK
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup JDK 17
|
- name: Setup JDK 21
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '21'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 22
|
||||||
|
|
||||||
# 动态生成英文版 capacitor.config.json(webDir 指向 en/ 目录)
|
# 动态生成英文版 capacitor.config.json(webDir 指向 en/ 目录)
|
||||||
- name: Create capacitor.config.json (en)
|
- name: Create capacitor.config.json (en)
|
||||||
@@ -153,7 +153,7 @@ jobs:
|
|||||||
run: mv android/app/build/outputs/apk/debug/app-debug.apk EmbyX-en.apk
|
run: mv android/app/build/outputs/apk/debug/app-debug.apk EmbyX-en.apk
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: embyx-en
|
name: embyx-en
|
||||||
path: EmbyX-en.apk
|
path: EmbyX-en.apk
|
||||||
@@ -167,7 +167,7 @@ jobs:
|
|||||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Download all artifacts
|
- name: Download all artifacts
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v7
|
||||||
|
|
||||||
- name: Verify APK files exist
|
- name: Verify APK files exist
|
||||||
run: |
|
run: |
|
||||||
@@ -176,7 +176,7 @@ jobs:
|
|||||||
test -f "embyx-en/EmbyX-en.apk"
|
test -f "embyx-en/EmbyX-en.apk"
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v3
|
||||||
with:
|
with:
|
||||||
# 如果是 main 分支,固定使用 preview 标签以便滚动更新
|
# 如果是 main 分支,固定使用 preview 标签以便滚动更新
|
||||||
tag_name: ${{ github.ref_name == 'main' && 'preview' || (github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name) }}
|
tag_name: ${{ github.ref_name == 'main' && 'preview' || (github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name) }}
|
||||||
|
|||||||
+3
-3
@@ -7,10 +7,10 @@
|
|||||||
"build:android": "npx cap sync android"
|
"build:android": "npx cap sync android"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^5.0.0",
|
"@capacitor/android": "^8.3.1",
|
||||||
"@capacitor/core": "^5.0.0"
|
"@capacitor/core": "^8.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@capacitor/cli": "^5.0.0"
|
"@capacitor/cli": "^8.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user