1+ name : Build Python IDE APK
2+
3+ on :
4+ push :
5+ branches : [main, master]
6+ pull_request :
7+ branches : [main, master]
8+ workflow_dispatch :
9+
10+ jobs :
11+ build :
12+ runs-on : ubuntu-latest
13+
14+ steps :
15+ - name : Checkout repository
16+ uses : actions/checkout@v4
17+
18+ - name : Clone Flutter SDK
19+ run : |
20+ cd $HOME
21+ git clone --depth 1 --branch stable https://github.com/flutter/flutter.git
22+ echo "$HOME/flutter/bin" >> $GITHUB_PATH
23+
24+ - name : Setup Flutter
25+ run : |
26+ flutter --version
27+ flutter config --no-analytics
28+ flutter precache
29+
30+ - name : Cache dependencies
31+ uses : actions/cache@v4
32+ with :
33+ path : |
34+ ~/.pub-cache
35+ ~/.gradle/caches
36+ ~/.gradle/wrapper
37+ key : ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
38+ restore-keys : |
39+ ${{ runner.os }}-flutter-
40+ ${{ runner.os }}-
41+
42+ - name : Get dependencies
43+ working-directory : ./python_ide
44+ run : flutter pub get
45+
46+ - name : Run static analysis
47+ working-directory : ./python_ide
48+ run : flutter analyze --no-fatal-infos --no-fatal-warnings
49+
50+ - name : Build debug APK
51+ working-directory : ./python_ide
52+ run : flutter build apk --debug
53+
54+ - name : Build release APK
55+ working-directory : ./python_ide
56+ run : flutter build apk --release
57+
58+ - name : Upload debug APK
59+ uses : actions/upload-artifact@v4
60+ with :
61+ name : debug-apk
62+ path : python_ide/build/app/outputs/flutter-apk/app-debug.apk
63+ retention-days : 7
64+
65+ - name : Upload release APK
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : release-apk
69+ path : python_ide/build/app/outputs/flutter-apk/app-release.apk
70+ retention-days : 30
71+
72+ - name : Upload build logs
73+ if : failure()
74+ uses : actions/upload-artifact@v4
75+ with :
76+ name : build-logs
77+ path : |
78+ python_ide/build/logs/
79+ python_ide/android/.gradle/**/*.log
80+ retention-days : 7
0 commit comments