-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from learningequality/vendor_build
Update Android App building and runtime
- Loading branch information
Showing
35 changed files
with
603 additions
and
494 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: Build Android App | ||
|
||
on: | ||
workflow_dispatch: | ||
# Inputs the workflow accepts. | ||
inputs: | ||
whl-url: | ||
description: 'URL for Kolibri whl file' | ||
required: true | ||
arch: | ||
description: 'Architecture of the build' | ||
required: true | ||
default: '32bit' | ||
type: choice | ||
options: | ||
- 32bit | ||
- 64bit | ||
workflow_call: | ||
inputs: | ||
whl-file-name: | ||
required: true | ||
type: string | ||
arch: | ||
description: 'Architecture of the build: 32bit or 64bit' | ||
required: true | ||
type: string | ||
ref: | ||
description: 'A ref for this workflow to check out its own repo' | ||
required: true | ||
type: string | ||
outputs: | ||
apk-file-name: | ||
description: "APK file name" | ||
value: ${{ jobs.build_apk.outputs.apk-file-name }} | ||
|
||
jobs: | ||
build_apk: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
apk-file-name: ${{ steps.get-apk-filename.outputs.apk-file-name }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
if: ${{ !inputs.ref }} | ||
- uses: actions/checkout@v2 | ||
if: ${{ inputs.ref }} | ||
with: | ||
repository: learningequality/kolibri-android-installer | ||
ref: ${{ inputs.ref }} | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/cache@v2 | ||
with: | ||
# This is where python for android puts its intermediary build | ||
# files - we cache this to improve build performance, but be | ||
# aggressive in clearing the cache whenever any file changes | ||
# in the repository. | ||
path: ~/.local | ||
key: ${{ runner.os }}-local-${{ github.event.inputs.arch || inputs.arch }}-${{ hashFiles('*') }} | ||
restore-keys: | | ||
${{ runner.os }}-local-${{ github.event.inputs.arch || inputs.arch }}- | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Download the whlfile from URL | ||
if: ${{ github.event.inputs.whl-url }} | ||
run: make get-whl whl=${{ github.event.inputs.whl-url }} | ||
- name: Download the whlfile from artifacts | ||
if: ${{ inputs.whl-file-name }} | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: ${{ inputs.whl-file-name }} | ||
path: whl | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Build the app | ||
env: | ||
ARCH: ${{ github.event.inputs.arch || inputs.arch }} | ||
# No need to set the ANDROID_HOME environment variable here that is used for | ||
# setting up the ANDROID SDK and ANDROID NDK, as the github actions images | ||
# have these SDKs and NDKs already installed. | ||
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#environment-variables-3 | ||
ANDROIDSDK: ${{ env.ANDROID_SDK_ROOT }} | ||
ANDROIDNDK: ${{ env.ANDROID_NDK_ROOT }} | ||
run: make kolibri.apk.unsigned | ||
- name: Get APK filename | ||
id: get-apk-filename | ||
run: echo "::set-output name=apk-file-name::$(ls dist | grep .apk | cat)" | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.get-apk-filename.outputs.apk-file-name }} | ||
path: dist/${{ steps.get-apk-filename.outputs.apk-file-name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Linting | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
pre_job: | ||
name: Path match check | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
github_token: ${{ github.token }} | ||
paths_ignore: '["**.po", "**.json"]' | ||
linting: | ||
name: All file linting | ||
needs: pre_job | ||
if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: pre-commit/[email protected] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
src/kolibri | ||
src/preseeded_kolibri_home | ||
src/extra-packages | ||
tmpenv | ||
whl/* | ||
|
||
# File format for signing key | ||
*.jks | ||
|
||
# Generated for pew | ||
project_info.json | ||
# pew output folder | ||
# output folder | ||
dist/ | ||
|
||
__pycache__ | ||
*.pyc | ||
build_docker | ||
build/ | ||
bin/ | ||
build.log | ||
tmphome/ | ||
static/ | ||
android_root/ | ||
|
||
*.apk | ||
.env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--window | ||
--bootstrap "webview" | ||
--package "org.learningequality.Kolibri" | ||
--name "Kolibri" | ||
--dist_name "kolibri" | ||
--private "src" | ||
--orientation sensor | ||
--requirements python3,android,pyjnius,genericndkbuild,sqlite3,cryptography,twisted,attrs,bcrypt,service_identity,pyasn1,pyasn1_modules,pyopenssl,openssl,six | ||
--android-api 30 | ||
--minsdk 21 | ||
--permission WRITE_EXTERNAL_STORAGE | ||
--permission ACCESS_NETWORK_STATE | ||
--permission FOREGROUND_SERVICE | ||
--service server:server.py | ||
--service remoteshell:remoteshell.py | ||
--presplash assets/icon.png | ||
--presplash-color #FFFFFF | ||
--icon assets/icon.png | ||
--fileprovider-paths src/fileprovider_paths.xml | ||
--add-asset assets/_load.html:_load.html | ||
--whitelist ./allowlist.txt | ||
--blacklist ./blocklist.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
repos: | ||
- repo: https://github.com/python/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
types_or: [ python, pyi ] | ||
exclude: '^.+?\.template$' | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
exclude: '^.+?\.template$' | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
exclude: '^.+?\.template$' | ||
- id: check-yaml | ||
exclude: '^.+?\.template$' | ||
- id: check-added-large-files | ||
exclude: '^.+?\.template$' | ||
- id: debug-statements | ||
exclude: '^.+?\.template$' | ||
- id: end-of-file-fixer | ||
exclude: '^.+?(\.json|\.template)$' | ||
|
||
- repo: https://github.com/asottile/reorder_python_imports | ||
rev: v2.6.0 | ||
hooks: | ||
- id: reorder-python-imports |
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
Oops, something went wrong.