-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (87 loc) · 3.51 KB
/
python-app.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on:
push:
branches: [ main, develop ]
tags:
- '*'
jobs:
build:
name: build
env:
ANDROID_API_LEVEL: 30
ANDROID_SDK_BUILD_TOOLS_VERSION: 30.0.2
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/
VERSION: 0.82
ARCH: armeabi-v7a
runs-on: ubuntu-latest
steps:
- name: Checkout geniustmusicplayer
uses: actions/checkout@v2
# helps with GitHub runner running out of space
- name: Free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y clean
- name: Install python-for-android (P4A) dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential ccache git zlib1g-dev python3 python3-dev libncurses5:i386 libstdc++6:i386 zlib1g:i386 openjdk-8-jdk unzip ant ccache autoconf libtool libssl-dev
pip install Cython==0.29.22
- name: Fork and Install allerter/P4A
run: |
git clone https://github.com/allerter/python-for-android
sudo pip install -e ./python-for-android
- name: test path
run: |
which p4a
- name: Download Android SDK and NDK
run: make --file python-for-android/ci/makefiles/android.mk
- name: Build APK
env:
ANDROID_NDK_HOME: /usr/local/lib/android/sdk/android-ndk
run: |
cd geniustmusicplayer
export CURRENT_DIR=$(echo | pwd)
p4a apk \
--enable-androidx \
--arch ${{ env.ARCH }} \
--ndk_dir ${{ env.ANDROID_NDK_HOME }} \
--ndk-api 21 \
--android_api ${{ env.ANDROID_API_LEVEL }} \
--bootstrap sdl2 \
--dist_name geniustmusicplayer \
--name="GeniusT Music Player" \
--version ${{ env.VERSION }} \
--package org.allerter.geniustmusicplayer \
--requirements python3,kivy==2.0.0,https://github.com/kivymd/KivyMD/archive/c792038.zip,android,sdl2_ttf==2.0.15,requests,urllib3,idna,chardet,oscpy,pillow \
--orientation portrait \
--window \
--private $CURRENT_DIR \
--permission INTERNET \
--permission ACCESS_NETWORK_STATE \
--permission FOREGROUND_SERVICE \
--service gtplayer:$CURRENT_DIR/service.py \
--depend "com.android.support:support-compat:28.0.0" \
--depend "androidx.legacy:legacy-support-v4:1.0.0" \
--depend "com.google.code.gson:gson:2.8.5" \
--presplash-lottie $CURRENT_DIR/images/presplash.json \
--presplash-color white \
--icon $CURRENT_DIR/images/icon.png \
--add-aar $CURRENT_DIR/spotify-auth-release-1.2.3.aar \
--add-aar $CURRENT_DIR/genius-auth-release-1.2.4.aar \
--intent-filters $CURRENT_DIR/intent_filters.xml
- uses: actions/upload-artifact@v1
with:
name: build_apk_file
path: geniustmusicplayer/geniustmusicplayer__${{ env.ARCH }}-debug-${{ env.VERSION }}-.apk
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_COMPRESS: zip
GHR_PATH: geniustmusicplayer/geniustmusicplayer__${{ env.ARCH }}-debug-${{ env.VERSION }}-.apk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}