-
Notifications
You must be signed in to change notification settings - Fork 13
104 lines (88 loc) · 3.03 KB
/
Copy pathdebug.yml
File metadata and controls
104 lines (88 loc) · 3.03 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
95
96
97
98
99
100
101
102
103
104
name: Build Kivy Android APK In Debug Mode
on:
workflow_dispatch:
permissions:
contents: write
actions: read
checks: read
env:
ANDROID_SDK_ROOT: /usr/local/lib/android/sdk
ANDROID_HOME: /usr/local/lib/android/sdk
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64
CYTHON_LANGUAGE_LEVEL: "3"
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.java-home=$JAVA_HOME -Dorg.gradle.jvmargs=-Xmx2048m"
jobs:
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'#3.9以上cython无long The version above 3.9 of cython has no long integer
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
git zip unzip \
python3-pip autoconf automake libtool \
pkg-config zlib1g-dev libncurses5-dev \
libncursesw5-dev cmake libffi-dev libssl-dev \
curl unzip openjdk-17-jdk libltdl-dev
- name: Install Buildozer and dependencies
run: |
python -m pip install --upgrade pip
#下载依赖库 add your requirements
pip install buildozer cython==0.29.33 kivy kivymd
#何意味 You will need it
pip install python-for-android
- name: Build APK with Buildozer
run: |
export PATH="$HOME/.local/bin:$PATH"
echo "Let's have a check:"
java -version
python --version
buildozer --version
#设置环境变量解决网络问题 set environment variables to solve network problems
export BUILDODER_ALLOW_PLATFORM_EXEC=1
export USE_COLORS=0
#开始构筑 start building
#buildozer -v android clean 2>&1 | tee clean.log
#buildozer -v android update 2>&1 | tee update.log
buildozer -v android debug 2>&1 | tee buildozer.log
#查找所有APK文件并复制到bin目录 find all APK files and copy them to the bin directory
find . -name "*.apk" -exec cp {} ./ \; 2>/dev/null || true
- name: Check if APK was built
id: check-build
run: |
if ls *.apk 1> /dev/null 2>&1; then
echo "BUILD_FINAL_SUCCESS=true" >> $GITHUB_OUTPUT
echo "Found APK files:"
ls -la *.apk
else
echo "BUILD_FINAL_SUCCESS=false" >> $GITHUB_OUTPUT
echo "Didn't found APK files."
fi
- name: Upload APK artifact
if: steps.check-build.outputs.BUILD_FINAL_SUCCESS == 'true'
uses: actions/upload-artifact@v4
with:
name: kivy-app-apk
path: bin/*.apk
retention-days: 30
- name: Upload build logs
if: always()
uses: actions/upload-artifact@v4
with:
name: build-logs
path: |
buildozer.log
#clean.log
#update.log
retention-days: 7