构建环境镜像添加
This commit is contained in:
@@ -12,6 +12,10 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
releases: write
|
releases: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
||||||
|
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
android:
|
android:
|
||||||
name: Build Android APK
|
name: Build Android APK
|
||||||
@@ -113,7 +117,7 @@ jobs:
|
|||||||
flutter doctor -v
|
flutter doctor -v
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: flutter pub get
|
run: flutter pub get --enforce-lockfile
|
||||||
|
|
||||||
- name: Restore Android signing files
|
- name: Restore Android signing files
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -145,7 +149,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
rm -rf build dist .dart_tool android/.gradle
|
rm -rf build dist android/.gradle
|
||||||
|
|
||||||
pkg_dir="$PWD/dist/android"
|
pkg_dir="$PWD/dist/android"
|
||||||
if [ -d "$pkg_dir" ]; then
|
if [ -d "$pkg_dir" ]; then
|
||||||
@@ -153,7 +157,7 @@ jobs:
|
|||||||
rm -rf "$pkg_dir"
|
rm -rf "$pkg_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build_args=(--release)
|
build_args=(--release --no-pub)
|
||||||
if [ -n "${IP_NODE_API_BASE_URL:-}" ]; then
|
if [ -n "${IP_NODE_API_BASE_URL:-}" ]; then
|
||||||
build_args+=("--dart-define=IP_NODE_API_BASE_URL=${IP_NODE_API_BASE_URL}")
|
build_args+=("--dart-define=IP_NODE_API_BASE_URL=${IP_NODE_API_BASE_URL}")
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -160,6 +160,14 @@ Linux: Debian 12
|
|||||||
flutter pub get
|
flutter pub get
|
||||||
```
|
```
|
||||||
|
|
||||||
|
如果当前网络无法解析 `pub.dev`,先设置 Pub/Flutter 镜像:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
$env:PUB_HOSTED_URL="https://pub.flutter-io.cn"
|
||||||
|
$env:FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn"
|
||||||
|
flutter pub get
|
||||||
|
```
|
||||||
|
|
||||||
### 运行项目
|
### 运行项目
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -170,11 +178,11 @@ flutter run # pdf 和 音视频会再构建过程中下载github上的依赖,
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Android
|
# Android
|
||||||
flutter build apk --release
|
flutter build apk --release --no-pub
|
||||||
# Linux
|
# Linux
|
||||||
flutter build -d linux --release
|
flutter build -d linux --release --no-pub
|
||||||
# windows
|
# windows
|
||||||
flutter build -d windows --release
|
flutter build -d windows --release --no-pub
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user