-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 2.99 KB
/
Copy pathbuild_android.yaml
File metadata and controls
94 lines (77 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build API Debug Helper APK
on:
workflow_dispatch:
permissions:
contents: write
actions: write
jobs:
build_apk:
name: Build release APK
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make Gradle wrapper executable
run: chmod +x ./gradlew
- name: Build signed release APK
run: ./gradlew :app:assembleRelease
- name: Generate build timestamp
id: timestamp
run: echo "ts=$(date +'%Y%m%d-%H%M%S')" >> "$GITHUB_OUTPUT"
- name: Rename APK with timestamp
run: |
mv app/build/outputs/apk/release/app-release.apk \
app/build/outputs/apk/release/api-debug-helper-${{ steps.timestamp.outputs.ts }}.apk
- name: Delete old Artifacts
run: |
for id in $(gh api "repos/${{ github.repository }}/actions/artifacts" --jq '.artifacts[] | select(.name | startswith("api-debug-helper")) | .id'); do
echo "Deleting artifact $id"
gh api "repos/${{ github.repository }}/actions/artifacts/$id" -X DELETE
done
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release APK
uses: actions/upload-artifact@v4
with:
name: api-debug-helper-release-${{ steps.timestamp.outputs.ts }}
path: app/build/outputs/apk/release/api-debug-helper-${{ steps.timestamp.outputs.ts }}.apk
- name: Delete old release tag if exists
run: |
gh release delete latest --yes || true
git push origin :refs/tags/latest || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: API Debug Helper - Latest Build
body: |
调试助手 APK 自动构建版本
**用途**: 测试 Google AI Edge Gallery 本地 API 服务
**目标项目**: https://github.com/bugroom/google-ai-edge-gallery-local-api
**构建时间**: ${{ github.event.head_commit.timestamp }}
**提交**: ${{ github.sha }}
### 功能特性
- 测试 /health 健康检查
- 获取 /v1/models 模型列表
- 发送 /v1/chat/completions 聊天请求
- 支持流式和非流式响应
- 应用内日志查看
### 安装
1. 下载 APK 文件
2. 在 Android 设备上安装
3. 配置 Gallery API 服务地址即可测试
files: |
app/build/outputs/apk/release/api-debug-helper-${{ steps.timestamp.outputs.ts }}.apk
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}