Skip to content

Automate Android APK deployment from Python using Flet for streamlined workflow.

Notifications You must be signed in to change notification settings

isaffathir/FletToAPK

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 

Repository files navigation


Building Your Flet APK 📱

This guide will help you build an APK for your Flet project using GitHub Actions and Termux/Linux terminal.

Prerequisites🕳️

  • GitHub account
  • Termux or a Linux terminal
  • Basic knowledge of GitHub Actions and terminal commands

Steps🚶

1. Create a New Repository💾

Create a new repository on GitHub and add a file named build.yml in the .github/workflows directory.

2. Add Workflow Configuration💡

Paste the following code into the build.yml file:

name: Install and Run tmate
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Install tmate
        run: |
          sudo apt-get update
          sudo apt-get install -y tmate
      - name: Run tmate
        uses: mxschmitt/action-tmate@v3
        with:
          tmate-server-host: ssh.tmate.io
          tmate-server-port: 22
          tmate-server-rsa-fingerprint: SHA256:Hthk2T/M/Ivqfk1YYUn5ijC2Att3+UPzD7Rn72P5VWs
          tmate-server-ed25519-fingerprint: SHA256:jfttvoypkHiQYUqUCwKeqd9d1fJj/ZiQlFOHVl6E9sI
          timeout-minutes: 120

3. Run the GitHub Action▶️

  • Save the build.yml file.
  • Navigate to the 'Actions' tab in your GitHub repository and run the action.

4. Get the SSH Key🔑

Once the action has run, it will generate an SSH key. Copy this key, which will look something like:

ssh dHYFJJVCFTJJ.tmate.io

5. Connect to the SSH Server🖥️

Paste the copied SSH key into your Termux or Linux terminal to connect to the SSH server.

Installing Flet and Dependencies🔽

Option 1: Manual Installation🔽

Run the following commands on the SSH server:

wget https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.22.0-stable.tar.xz
tar xJf flutter_linux_3.22.0-stable.tar.xz
echo "export PATH=\$PATH:\$HOME/path/to/flutter/bin" >> ~/.profile
source ~/.profile
sudo apt install android-sdk sdkmanager
sdkmanager --licenses
sudo -E sdkmanager "ndk;23.1.7779620"
pip install flet --upgrade

Note: Replace path/to/flutter/bin with the actual path where you extracted Flutter.

Option 2: Automated Installation🔄

  • Clone the repository:

    git clone https://github.com/mahmoodsaed/FletToAPK.git
  • Navigate to the FletToAPK directory:

    cd FletToAPK
  • Run the install script:

    bash install.sh

Creating and Building Your Flet Project✅

1. Create a Flet Project📲

flet create Project_name

2. Navigate to Your Project Folder↘️

cd path/to/project/Project_name

3. Build the APK🧑‍🔧

flet build apk

Upload and Download Your APK⏫

1. Navigate to the APK Build Folder↘️

cd build/apk

2. Upload the APK↗️

curl -F file=@path_to_apk_file https://file.io

This will generate a download link. Copy this link to download your APK.


By following these steps, you'll be able to build and download your Flet APK. Have fun!

About

Automate Android APK deployment from Python using Flet for streamlined workflow.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%