修正在线打包
(cherry picked from commit 1af2aa64f26db5f7e3d41409e714be1789f17345)
This commit is contained in:
parent
773047838c
commit
8204895199
32
.github/workflows/build-multiplatform.yml
vendored
32
.github/workflows/build-multiplatform.yml
vendored
@ -45,6 +45,11 @@ on:
|
||||
required: true
|
||||
default: 'https://xpp5.oss-ap-southeast-1.aliyuncs.com/bear1.txt'
|
||||
type: string
|
||||
encryption_key:
|
||||
description: '加密密钥'
|
||||
required: true
|
||||
default: 'c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx'
|
||||
type: string
|
||||
platforms:
|
||||
description: '构建平台 (多选: android,windows,macos,linux)'
|
||||
required: true
|
||||
@ -293,7 +298,7 @@ jobs:
|
||||
name: libcore-android
|
||||
path: android/app/libs/
|
||||
|
||||
- name: ⚙️ 配置 API 和 OSS
|
||||
- name: ⚙️ 配置 API、OSS 和加密密钥
|
||||
run: |
|
||||
CONFIG_FILE="lib/app/common/app_config.dart"
|
||||
API_DOMAIN="${{ inputs.api_domain || 'api.maodag.top' }}"
|
||||
@ -301,16 +306,22 @@ jobs:
|
||||
OSS_URL_2="${{ inputs.oss_url_2 || 'https://xgp3.oss-ap-northeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_3="${{ inputs.oss_url_3 || 'https://xpp4.oss-ap-northeast-2.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_4="${{ inputs.oss_url_4 || 'https://xpp5.oss-ap-southeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
ENCRYPTION_KEY="${{ inputs.encryption_key || 'c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx' }}"
|
||||
|
||||
echo "🔧 配置参数:"
|
||||
echo " API: $API_DOMAIN"
|
||||
echo " OSS: $OSS_URL_1"
|
||||
echo " 密钥: ${ENCRYPTION_KEY:0:10}..."
|
||||
|
||||
# 转义密钥中的特殊字符
|
||||
ENCRYPTION_KEY_ESCAPED=$(echo "$ENCRYPTION_KEY" | sed 's/[[.*^$()+?{|]/\\&/g')
|
||||
|
||||
sed -i "s|api\.maodag\.top|$API_DOMAIN|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://ppp2\.oss-cn-hongkong\.aliyuncs\.com/bear1\.txt|$OSS_URL_1|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xgp3\.oss-ap-northeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_2|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp4\.oss-ap-northeast-2\.aliyuncs\.com/bear1\.txt|$OSS_URL_3|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp5\.oss-ap-southeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_4|g" "$CONFIG_FILE"
|
||||
sed -i "s|c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx|$ENCRYPTION_KEY_ESCAPED|g" "$CONFIG_FILE"
|
||||
|
||||
echo "✅ 配置完成"
|
||||
|
||||
@ -372,7 +383,7 @@ jobs:
|
||||
name: libcore-windows
|
||||
path: libcore/bin/
|
||||
|
||||
- name: ⚙️ 配置 API 和 OSS
|
||||
- name: ⚙️ 配置 API、OSS 和加密密钥
|
||||
shell: bash
|
||||
run: |
|
||||
CONFIG_FILE="lib/app/common/app_config.dart"
|
||||
@ -381,12 +392,16 @@ jobs:
|
||||
OSS_URL_2="${{ inputs.oss_url_2 || 'https://xgp3.oss-ap-northeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_3="${{ inputs.oss_url_3 || 'https://xpp4.oss-ap-northeast-2.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_4="${{ inputs.oss_url_4 || 'https://xpp5.oss-ap-southeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
ENCRYPTION_KEY="${{ inputs.encryption_key || 'c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx' }}"
|
||||
|
||||
ENCRYPTION_KEY_ESCAPED=$(echo "$ENCRYPTION_KEY" | sed 's/[[.*^$()+?{|]/\\&/g')
|
||||
|
||||
sed -i "s|api\.maodag\.top|$API_DOMAIN|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://ppp2\.oss-cn-hongkong\.aliyuncs\.com/bear1\.txt|$OSS_URL_1|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xgp3\.oss-ap-northeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_2|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp4\.oss-ap-northeast-2\.aliyuncs\.com/bear1\.txt|$OSS_URL_3|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp5\.oss-ap-southeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_4|g" "$CONFIG_FILE"
|
||||
sed -i "s|c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx|$ENCRYPTION_KEY_ESCAPED|g" "$CONFIG_FILE"
|
||||
|
||||
- name: 📦 安装 Flutter 依赖
|
||||
run: |
|
||||
@ -466,7 +481,7 @@ jobs:
|
||||
run: |
|
||||
chmod +x libcore/bin/HiddifyCli
|
||||
|
||||
- name: ⚙️ 配置 API 和 OSS
|
||||
- name: ⚙️ 配置 API、OSS 和加密密钥
|
||||
run: |
|
||||
CONFIG_FILE="lib/app/common/app_config.dart"
|
||||
API_DOMAIN="${{ inputs.api_domain || 'api.maodag.top' }}"
|
||||
@ -474,12 +489,17 @@ jobs:
|
||||
OSS_URL_2="${{ inputs.oss_url_2 || 'https://xgp3.oss-ap-northeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_3="${{ inputs.oss_url_3 || 'https://xpp4.oss-ap-northeast-2.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_4="${{ inputs.oss_url_4 || 'https://xpp5.oss-ap-southeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
ENCRYPTION_KEY="${{ inputs.encryption_key || 'c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx' }}"
|
||||
|
||||
# macOS 使用不同的 sed 语法,需要转义
|
||||
ENCRYPTION_KEY_ESCAPED=$(echo "$ENCRYPTION_KEY" | sed 's/[[.*^$()+?{|]/\\&/g')
|
||||
|
||||
sed -i '' "s|api\.maodag\.top|$API_DOMAIN|g" "$CONFIG_FILE"
|
||||
sed -i '' "s|https://ppp2\.oss-cn-hongkong\.aliyuncs\.com/bear1\.txt|$OSS_URL_1|g" "$CONFIG_FILE"
|
||||
sed -i '' "s|https://xgp3\.oss-ap-northeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_2|g" "$CONFIG_FILE"
|
||||
sed -i '' "s|https://xpp4\.oss-ap-northeast-2\.aliyuncs\.com/bear1\.txt|$OSS_URL_3|g" "$CONFIG_FILE"
|
||||
sed -i '' "s|https://xpp5\.oss-ap-southeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_4|g" "$CONFIG_FILE"
|
||||
sed -i '' "s|c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx|$ENCRYPTION_KEY_ESCAPED|g" "$CONFIG_FILE"
|
||||
|
||||
- name: 📦 安装 Flutter 依赖
|
||||
run: |
|
||||
@ -549,7 +569,7 @@ jobs:
|
||||
run: |
|
||||
chmod +x libcore/bin/HiddifyCli
|
||||
|
||||
- name: ⚙️ 配置 API 和 OSS
|
||||
- name: ⚙️ 配置 API、OSS 和加密密钥
|
||||
run: |
|
||||
CONFIG_FILE="lib/app/common/app_config.dart"
|
||||
API_DOMAIN="${{ inputs.api_domain || 'api.maodag.top' }}"
|
||||
@ -557,12 +577,16 @@ jobs:
|
||||
OSS_URL_2="${{ inputs.oss_url_2 || 'https://xgp3.oss-ap-northeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_3="${{ inputs.oss_url_3 || 'https://xpp4.oss-ap-northeast-2.aliyuncs.com/bear1.txt' }}"
|
||||
OSS_URL_4="${{ inputs.oss_url_4 || 'https://xpp5.oss-ap-southeast-1.aliyuncs.com/bear1.txt' }}"
|
||||
ENCRYPTION_KEY="${{ inputs.encryption_key || 'c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx' }}"
|
||||
|
||||
ENCRYPTION_KEY_ESCAPED=$(echo "$ENCRYPTION_KEY" | sed 's/[[.*^$()+?{|]/\\&/g')
|
||||
|
||||
sed -i "s|api\.maodag\.top|$API_DOMAIN|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://ppp2\.oss-cn-hongkong\.aliyuncs\.com/bear1\.txt|$OSS_URL_1|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xgp3\.oss-ap-northeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_2|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp4\.oss-ap-northeast-2\.aliyuncs\.com/bear1\.txt|$OSS_URL_3|g" "$CONFIG_FILE"
|
||||
sed -i "s|https://xpp5\.oss-ap-southeast-1\.aliyuncs\.com/bear1\.txt|$OSS_URL_4|g" "$CONFIG_FILE"
|
||||
sed -i "s|c0qhq99a-nq8h-ropg-wrlc-ezj4dlkxqpzx|$ENCRYPTION_KEY_ESCAPED|g" "$CONFIG_FILE"
|
||||
|
||||
- name: 📦 安装 Flutter 依赖
|
||||
run: |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user