Rust d02eed3bd8 docs: 添加 GitHub Actions 构建文档并锁定 libcore 版本
- 添加完整的 GitHub Actions 构建指南文档
  - BUILD_GUIDE.md: Android 详细构建指南
  - MULTIPLATFORM_GUIDE.md: 多平台构建指南
  - HOW_TO_BUILD.md: 分步操作教程
  - QUICKSTART.md: 3步快速开始指南
  - INDEX.md: 文档总览索引
  - README.md: 基础说明
- 创建 docs/ 目录存放项目文档
- 锁定 libcore 子模块到 f993a57 (v3.1.7)
  - 防止在线编译时使用最新版本
  - 确保构建稳定性和一致性
2025-10-27 23:11:21 +08:00

91 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# GitHub Actions 构建说明
## 📋 工作流概览
### `build-android-apk.yml` - Android APK 自动构建
**触发条件:**
- ✅ 推送到 `main``develop` 分支
- ✅ 打 `v*` 标签时自动创建 Release
- ✅ 手动触发Actions 页面点击 "Run workflow"
**构建产物:**
- `libcore.aar` - sing-box 核心库
- `BearVPN-arm64-v8a-*.apk` - 64位 ARM 版本(推荐)
- `BearVPN-armeabi-v7a-*.apk` - 32位 ARM 版本
- `BearVPN-x86_64-*.apk` - 模拟器版本
---
## 🚀 使用方法
### 方法一:推送代码自动构建
```bash
git add .
git commit -m "feat: 新功能"
git push origin main
```
### 方法二:手动触发
1. 打开仓库 **Actions** 页面
2. 点击 **Build Android APK**
3. 点击 **Run workflow**
### 方法三:创建 Release
```bash
git tag v1.0.0
git push origin v1.0.0
```
---
## 📦 下载构建产物
- **Actions 页面:** 点击运行记录 → Artifacts 区域下载
- **Releases 页面:** 选择版本 → Assets 下载
---
## 🔧 配置 Release 签名(可选)
1. 生成密钥:
```bash
keytool -genkey -v -keystore release.keystore -alias bearvpn -keyalg RSA -keysize 2048 -validity 10000
```
2. 转换为 Base64
```bash
base64 release.keystore > keystore.base64.txt
```
3. 在 GitHub 仓库 **Settings → Secrets** 添加:
- `KEYSTORE_BASE64`
- `KEYSTORE_PASSWORD`
- `KEY_ALIAS`
- `KEY_PASSWORD`
---
## ⏱️ 构建时间
- libcore.aar: 10-15 分钟
- Flutter APK: 15-20 分钟
- **总计: 约 30 分钟**
---
## 🐛 常见问题
**Q: 构建失败 "libcore.aar not found"**
A: 检查 libcore 子模块是否正确初始化
**Q: Release 未创建**
A: 标签必须以 `v` 开头,如 `v1.0.0`
---
生成时间: 2025-10-27