Skip to content

Commit 034ec31

Browse files
authored
Merge branch 'kivy:develop' into firebase
2 parents 21cd0a9 + d0f93ca commit 034ec31

File tree

39 files changed

+333
-103
lines changed

39 files changed

+333
-103
lines changed

.github/workflows/custom-build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Custom build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
arch:
7+
description: "Comma separated architectures (e.g., armeabi-v7a, arm64-v8a, x86_64, x86)"
8+
required: true
9+
default: "armeabi-v7a,arm64-v8a,x86_64,x86"
10+
artifact:
11+
description: "Artifact type"
12+
required: true
13+
default: "apk"
14+
type: choice
15+
options:
16+
- "aab"
17+
- "aar"
18+
- "apk"
19+
bootstrap:
20+
description: "Bootstrap to use"
21+
required: true
22+
default: "sdl2"
23+
type: choice
24+
options:
25+
- "qt"
26+
- "sdl2"
27+
- "service_library"
28+
- "service_only"
29+
- "webview"
30+
mode:
31+
description: "Build mode"
32+
required: true
33+
default: "debug"
34+
type: choice
35+
options:
36+
- "debug"
37+
- "release"
38+
os:
39+
description: "Operating system to run on"
40+
required: true
41+
default: "ubuntu-latest"
42+
type: choice
43+
options:
44+
- "ubuntu-latest"
45+
- "macos-latest"
46+
requirements:
47+
description: "Comma separated requirements"
48+
required: true
49+
default: "python3,kivy"
50+
51+
env:
52+
APK_ARTIFACT_FILENAME: bdist_unit_tests_app-debug-1.1.apk
53+
AAB_ARTIFACT_FILENAME: bdist_unit_tests_app-release-1.1.aab
54+
AAR_ARTIFACT_FILENAME: bdist_unit_tests_app-release-1.1.aar
55+
PYTHONFORANDROID_PREREQUISITES_INSTALL_INTERACTIVE: 0
56+
57+
jobs:
58+
build:
59+
name: Build test APP [ ${{ github.event.inputs.arch }} | ${{ github.event.inputs.artifact }} | ${{ github.event.inputs.bootstrap }} | ${{ github.event.inputs.mode }} | ${{ github.event.inputs.os }} | ${{ github.event.inputs.requirements }}]
60+
runs-on: ${{ github.event.inputs.os }}
61+
steps:
62+
- name: Checkout python-for-android
63+
uses: actions/checkout@v4
64+
- name: Pull the python-for-android docker image
65+
run: make docker/pull
66+
- name: Build python-for-android docker image
67+
run: make docker/build
68+
- name: Build multi-arch artifact with docker
69+
run: |
70+
docker run --name p4a-latest kivy/python-for-android make ARCH=${{ github.event.inputs.arch }} ARTIFACT=${{ github.event.inputs.artifact }} BOOTSTRAP=${{ github.event.inputs.bootstrap }} MODE=${{ github.event.inputs.mode }} REQUIREMENTS=${{ github.event.inputs.requirements }} testapps-generic
71+
- name: Copy produced artifacts from docker container (*.apk, *.aab)
72+
if: github.event.inputs.bootstrap != 'service_library'
73+
run: |
74+
mkdir -p dist
75+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.APK_ARTIFACT_FILENAME }} dist/ || true
76+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.AAB_ARTIFACT_FILENAME }} dist/ || true
77+
- name: Copy produced artifacts from docker container (*.aar)
78+
if: github.event.inputs.bootstrap == 'service_library'
79+
run: |
80+
mkdir -p dist
81+
docker cp p4a-latest:/home/user/app/testapps/on_device_unit_tests/${{ env.AAR_ARTIFACT_FILENAME }} dist/
82+
- name: Rename artifacts to include the build platform name (*.apk, *.aab, *.aar)
83+
run: |
84+
if [ -f dist/${{ env.APK_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.APK_ARTIFACT_FILENAME }} dist/${{ github.event.inputs.os }}-${{ github.event.inputs.bootstrap }}-${{ env.APK_ARTIFACT_FILENAME }}; fi
85+
if [ -f dist/${{ env.AAB_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.AAB_ARTIFACT_FILENAME }} dist/${{ github.event.inputs.os }}-${{ github.event.inputs.bootstrap }}-${{ env.AAB_ARTIFACT_FILENAME }}; fi
86+
if [ -f dist/${{ env.AAR_ARTIFACT_FILENAME }} ]; then mv dist/${{ env.AAR_ARTIFACT_FILENAME }} dist/${{ github.event.inputs.os }}-${{ github.event.inputs.bootstrap }}-${{ env.AAR_ARTIFACT_FILENAME }}; fi
87+
- name: Upload artifacts
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: ${{ github.event.inputs.os }}-${{ github.event.inputs.bootstrap }}-artifacts
91+
path: dist
92+
# Cleanup the container after all steps are done
93+
- name: Cleanup Docker container
94+
run: docker rm p4a-latest
95+
if: always()

.github/workflows/docker.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
push:
66
branches:
77
- develop
8+
tags:
9+
- "*"
810
pull_request:
911

1012
jobs:
@@ -14,11 +16,17 @@ jobs:
1416
- uses: actions/checkout@v4
1517
- uses: docker/setup-buildx-action@v3
1618
- run: make docker/build
19+
- name: docker login
20+
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/')
1721
env:
1822
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
1923
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
24+
run: make docker/login
2025
- name: docker push
21-
if: github.ref == 'develop'
26+
if: github.ref == 'refs/heads/develop'
27+
run: make docker/push
28+
- name: docker push (tag)
29+
if: startsWith(github.ref, 'refs/tags/')
2230
run: |
23-
make docker/login
31+
make docker/tag DOCKER_TAG=${GITHUB_REF#refs/tags/}
2432
make docker/push

.github/workflows/push.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ env:
88
AAR_ARTIFACT_FILENAME: bdist_unit_tests_app-release-1.1.aar
99
PYTHONFORANDROID_PREREQUISITES_INSTALL_INTERACTIVE: 0
1010

11+
concurrency:
12+
group: build-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216

1317
flake8:
@@ -17,7 +21,7 @@ jobs:
1721
- name: Checkout python-for-android
1822
uses: actions/checkout@v4
1923
- name: Set up Python 3.x
20-
uses: actions/setup-python@v4
24+
uses: actions/setup-python@v5
2125
with:
2226
python-version: 3.x
2327
- name: Run flake8
@@ -38,7 +42,7 @@ jobs:
3842
- name: Checkout python-for-android
3943
uses: actions/checkout@v4
4044
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v4
45+
uses: actions/setup-python@v5
4246
with:
4347
python-version: ${{ matrix.python-version }}
4448
- name: Tox tests
@@ -64,8 +68,8 @@ jobs:
6468
bootstrap:
6569
- name: sdl2
6670
target: testapps-with-numpy
67-
- name: sdl2_scipy
68-
target: testapps-with-scipy
71+
# - name: sdl2_scipy # TODO: Re-enable this failing test.
72+
# target: testapps-with-scipy
6973
- name: webview
7074
target: testapps-webview
7175
- name: service_library

.github/workflows/pypi-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ jobs:
55
pypi_release:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v3
8+
- uses: actions/checkout@v4
99
- name: Set up Python 3.x
10-
uses: actions/setup-python@v4
10+
uses: actions/setup-python@v5
1111
with:
1212
python-version: '3.x'
1313
- name: Install dependencies
@@ -22,4 +22,4 @@ jobs:
2222
uses: pypa/gh-action-pypi-publish@v1.4.2
2323
with:
2424
user: __token__
25-
password: ${{ secrets.pypi_password }}
25+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)