Update README.md #89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Native Libs Android Package | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: '11' | |
- name: Set up Python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Upload requirements.txt | |
run: | | |
if [ ! -f requirements.txt ]; then | |
echo "requirements.txt not found!" | |
exit 1 | |
fi | |
cat requirements.txt | |
- name: Install Python Dependencies | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip install --upgrade pip | |
pip install git+https://github.com/flet-dev/python-for-android.git@3.11.6 | |
pip install --upgrade cython pipgrip | |
- name: Generate pipgrip.lock | |
run: | | |
source .venv/bin/activate | |
pipgrip $(cat requirements.txt) --lock | |
- name: Show pipgrip.lock | |
run: | | |
cat pipgrip.lock | |
- name: Append requirements.txt to pipgrip.lock | |
run: | | |
cat requirements.txt >> pipgrip.lock | |
- name: Install Dependencies | |
run: | | |
source .venv/bin/activate | |
pip install -r pipgrip.lock | |
- name: Build Lib Native | |
id: build_lib_native | |
run: | | |
source .venv/bin/activate # Activate virtual environment | |
p4a create --requirements=$(paste -s -d, pipgrip.lock) --arch arm64-v8a --arch armeabi-v7a --arch x86_64 --dist-name mydist | |
- name: Zip mydist folder | |
run: | | |
cd /home/runner/.local/share/python-for-android/dists | |
zip -r mydist.zip mydist | |
- name: List zip files | |
run: | | |
ls -la | |
- name: Upload ZIP artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mydist | |
path: /home/runner/.local/share/python-for-android/dists/mydist.zip |