-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (62 loc) · 2.37 KB
/
build_android.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
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.7 }
- { ARCH: arm64, API: 21, PYVER: 3.10.7 }
- { ARCH: arm, API: 21, PYVER: 3.11.2 }
- { ARCH: arm64, API: 21, PYVER: 3.11.2 }
- { ARCH: arm, API: 21, PYVER: 3.12.0 }
- { ARCH: arm64, API: 21, PYVER: 3.12.0 }
steps:
- name: Checkout main repo
uses: actions/checkout@v2
- 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@v2
with:
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 }}