Skip to content

Instantly share code, notes, and snippets.

@kulothunganug
Last active January 4, 2024 05:36
Show Gist options
  • Save kulothunganug/ba93c1561ae035bcb0ac63c2a006a969 to your computer and use it in GitHub Desktop.
Save kulothunganug/ba93c1561ae035bcb0ac63c2a006a969 to your computer and use it in GitHub Desktop.
Guide to compile a kivy app into apk using github

Follow these steps to compile your kivy application to an APK on GitHub (No linux needed).

Note: This method is only recommended if you don't have access to a linux or mac system

  1. Create an github account if you don't have.

  2. Create a repository, you could also create it as private.

  3. Goto your project directory (where main.py exists) and create a file in .github/workflows/build.yml (Create the folders if not already existed).

  4. Copy the workflow snippet (build.yml see below) and paste it in build.yml.

  5. Create buildozer.spec file by buildozer init or use this file (Make sure to rename default.spec to buildozer.spec).

  6. Make some tweaks in buildozer.spec like adding permissions or requirements, changing app name... (if needed).

  7. Push the files to github.

  8. Wait until the build finishes (takes ~15min).

  9. The output will be an zip archive, so you need to unzip it to get your apk file.

You don't need to repeat these all steps to produce new apk (with some changes) of the same project, just follow from step 6.

To know more head on to this page

name: CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# used to cache dependencies with a timeout
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
shell: bash
- name: Cache Buildozer global directory
uses: actions/cache@v2
with:
path: .buildozer_global
key: buildozer-global-${{ hashFiles('buildozer.spec') }} # Replace with your path
- name: Build with Buildozer
uses: ArtemSBulgakov/buildozer-action@v1
id: buildozer
with:
command: buildozer android debug
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: package
path: ${{ steps.buildozer.outputs.filename }}
Copy link

ghost commented May 23, 2023

Not working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment