-
-
Notifications
You must be signed in to change notification settings - Fork 11
97 lines (80 loc) · 2.73 KB
/
build_libs_and_unsigned_apk.yml
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
95
96
97
name: Build Libs And Unsigned APK
on:
# push:
# tags:
# - 'v*' # 触发条件:当推送标签以 'v' 开头时
workflow_dispatch: # 允许手动触发工作流
jobs:
build:
runs-on: ubuntu-22.04 # 使用 Ubuntu 运行环境
steps:
- name: Checkout code
uses: actions/checkout@v4
# with:
# submodules: true
# repository: catpuppyapp/PuppyGit
# fetch-depth: 1
# ref: main
# path: PuppyGit # if set, must use `$GITHUB_WORKSPACE/PuppyGit` to access the dir, else can simple use `$GITHUB_WORKSPACE`
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '17' # 设置 JDK 版本
distribution: 'temurin' # 指定 JDK 发行版(例如 'adopt', 'zulu', 'temurin', 'oracle' 等)
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
curl \
make \
tar \
maven \
unzip \
git
#
# - name: Setup cmake
# uses: jwlawson/actions-setup-cmake@v2
# with:
# cmake-version: '3.31.1'
- name: Install Require Software
run: bash $GITHUB_WORKSPACE/lib_build_scripts/1_installrequire.sh
- name: Download Src
run: bash $GITHUB_WORKSPACE/lib_build_scripts/2_downloadsrc.sh
- name: Build C Libs
run: |
export ppgit_c_lib_out=$GITHUB_WORKSPACE/app/src/main/jniLibs
cd $GITHUB_WORKSPACE/lib_build_scripts
rm -rf $ppgit_c_lib_out/*
bash 3_buildlibs.sh $ppgit_c_lib_out
- name: "List C Libs"
run: ls -R $GITHUB_WORKSPACE/app/src/main/jniLibs
- name: Upload C Libs
uses: actions/upload-artifact@v4
with:
name: c_libs
path: ${{ github.workspace }}/app/src/main/jniLibs/
retention-days: 15
- name: Build Release APK
run: |
cd $GITHUB_WORKSPACE
chmod +x gradlew
./gradlew clean
./gradlew assembleRelease
- name: Upload Release APK
uses: actions/upload-artifact@v4
with:
name: app-release-unsigned.apk
path: ${{ github.workspace }}/app/build/outputs/apk/release/app-release-unsigned.apk
retention-days: 15
- name: Build Debug APK
run: |
cd $GITHUB_WORKSPACE
chmod +x gradlew
./gradlew clean
./gradlew assembleDebug
- name: Upload Debug APK
uses: actions/upload-artifact@v4
with:
name: app-debug-unsigned.apk
path: ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk
retention-days: 15