Skip to content

Update build_android.yml #107

Update build_android.yml

Update build_android.yml #107

Workflow file for this run

name: Build Android
on:
push:
# Manual run
workflow_dispatch:
# Release-related code borrowed from
# https://github.com/actions/create-release/issues/14#issuecomment-555379810
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python3-android
strategy:
matrix:
env:
- { ARCH: arm, API: 21, PYVER: 3.7.16 }
- { ARCH: arm64, API: 21, PYVER: 3.7.16 }
- { ARCH: arm, API: 21, PYVER: 3.8.16 }
- { ARCH: arm64, API: 21, PYVER: 3.8.16 }
- { ARCH: arm, API: 21, PYVER: 3.9.16 }
- { ARCH: arm64, API: 21, PYVER: 3.9.16 }
- { ARCH: arm, API: 21, PYVER: 3.10.11 }
- { ARCH: arm64, API: 21, PYVER: 3.10.11 }
- { ARCH: arm, API: 21, PYVER: 3.11.9 }
- { ARCH: arm64, API: 21, PYVER: 3.11.9 }
- { ARCH: arm, API: 21, PYVER: 3.12.7 }
- { ARCH: arm64, API: 21, PYVER: 3.12.7 }
- { ARCH: arm, API: 23, PYVER: 3.13.0 }
- { ARCH: arm64, API: 23, PYVER: 3.13.0 }
steps:
- name: Checkout main repo
uses: actions/checkout@v4
- name: Update scripts permission
run: |
find -type f -iname "*.sh" -exec chmod +x {} \;
find ./Android -type f -iname "*.py" -exec chmod +x {} \;
- name: Building
run: |
docker run --rm -v $(pwd):/python3-android \
--env ARCH=${{ matrix.env.ARCH }} \
--env ANDROID_API=${{ matrix.env.API }} \
--env PYVER=${{ matrix.env.PYVER }} \
python:${{ matrix.env.PYVER }}-slim /python3-android/docker-build.sh
- name: Create package
id: create_package
run: |
cd embedabble
package_filename=python3-android-${{ matrix.env.PYVER }}-${{ matrix.env.ARCH }}.zip
sudo 7z a -tzip $package_filename * -r
echo ::set-output name=package_filename::$package_filename
- name: Save build
uses: actions/upload-artifact@v4
with:
name: ${{ steps.create_package.outputs.package_filename }}
path: python3-android/embedabble/${{ steps.create_package.outputs.package_filename }}
if-no-files-found: error
- name: Publish to Digital Ocean
uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.ACCESS_KEY}}
secret_key: ${{ secrets.SECRET_KEY }}
space_name: ${{ secrets.SPACE_NAME }}
space_region: ${{ secrets.SPACE_REGION }}
source: python3-android/embedabble/${{ steps.create_package.outputs.package_filename }}