Skip to content

Karan-Frost/Build-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Android CI Bot Script (Python)

Python

A Python script designed to automate Android ROM building and interaction with Telegram. It handles source syncing, compilation, progress monitoring, and file uploading.

Adapted by Frost from the original Bash script by hipexscape.

Requirements

  • Python 3.x
  • requests library (pip install requests)
  • repo tool installed and in your PATH
  • rclone installed and configured

Setup

  1. Clone the repository: Clone this repository to the root of your source tree (or anywhere accessible).

  2. Install dependencies:

    pip install requests
  3. Create a Configuration File: Create a file named config.env (or any name like config.device.env) in the same directory as the script (for reference, see config.example.env). You can create multiple config files for different devices.

    Template:

    # Device Configuration
    DEVICE=your_device_codename
    VARIANT=user
    OFFICIAL_FLAG=False
    
    # Telegram Configuration
    CHAT_ID=-100xxxxxxxx
    BOT_TOKEN=your_bot_token
    ERROR_CHAT_ID=-100xxxxxxxx
    
    # Upload Configuration
    RCLONE_REMOTE=drive
    RCLONE_FOLDER=roms/device_name
    
    # Initial install zip Configuration
    INITIAL_INSTALL_ZIP_DEVICES=codename|codename2
    
    # Server Management
    POWEROFF=False

Configuration Variables

Variable Description
DEVICE Your device codename (e.g., zircon, veux)
VARIANT Build variant (user, userdebug, or eng)
OFFICIAL_FLAG Set to True if this is an official build, False otherwise
CHAT_ID Your Telegram Group/Channel Chat ID (e.g., -100xxxxxxx)
BOT_TOKEN Your HTTP API Bot Token from BotFather
ERROR_CHAT_ID Secondary Chat ID for sending error logs (can be same as CHAT_ID)
RCLONE_REMOTE Your rclone remote name (e.g., drive)
RCLONE_FOLDER The target folder on the rclone remote
INITIAL_INSTALL_ZIP_DEVICES The devices you want the initial install zip to be flashable to. If not specified, it falls back to DEVICE
POWEROFF Set to True to power off the server after completion

Artifact Uploads

The script automatically uploads the build results to two locations:

  1. ROM Zip: The main ROM file is uploaded to your Rclone Remote defined in the config (e.g., Google Drive, Mega, OneDrive).
  2. Other Files: Other files (e.g., OTA JSON, Initial Install Zip) is uploaded to GoFile.io for quick, temporary access.

Command Line Options

Run the script using python3 ci_bot.py [options].

Option Flag Description
Config --config Path to your specific configuration file. Defaults to config.env if not specified.
Sync -s, --sync Runs repo sync before starting the build. Useful for fetching the latest source changes.
Clean -c, --clean Deletes the entire out/ directory. Use this for a completely fresh build (takes longer).
Disk Opt. --d-o, --disk-optimization Runs a disk optimizing script before building.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages