Build Ubports #1
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
#================================================= | |
# Description: Build ubports using GitHub Actions | |
# Lisence: MIT | |
# Author: 0312birdzhang | |
# Credit: https://github.com/P3TERX/Actions-OpenWrt | |
#================================================= | |
name: Build Ubports | |
on: workflow_dispatch | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Initialization environment | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
openjdk-8-jdk android-tools-adb bc bison \ | |
build-essential curl flex g++-multilib gcc-multilib gnupg gperf \ | |
imagemagick lib32ncurses-dev \ | |
lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev \ | |
libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev \ | |
qemu-user-static qemu-system-arm e2fsprogs simg2img \ | |
libtinfo5 libncurses5 gzip virtualenv | |
sudo docker rmi `docker images -q` | |
sudo rm -rf \ | |
/usr/share/dotnet \ | |
/etc/mysql \ | |
/etc/php | |
mkdir -p ~/bin | |
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin | |
chmod +x ~/bin/repo | |
git config --global user.name "BirdZhang" | |
git config --global user.email "[email protected]" | |
source halium.env | |
export FLASHABLE_DIR=ubports-`date +%Y%m%d-%H%M%S`-devel-$DEVICE | |
echo $FLASHABLE_DIR > ~/.current_version | |
echo "::set-env name=VENDOR::$(echo $VENDOR)" | |
echo "::set-env name=DEVICE::$(echo $DEVICE)" | |
echo "::set-env name=ANDROID_ROOT::$(echo $ANDROID_ROOT)" | |
echo "::set-env name=FLASHABLE_DIR::$(echo $FLASHABLE_DIR)" | |
- name: Downloading source code | |
run: | | |
source halium.env | |
mkdir -p $ANDROID_ROOT | |
cd $ANDROID_ROOT | |
repo init -u https://github.com/Halium/android -b halium-7.1 --depth=1 | |
repo sync -j8 -c --no-clone-bundle --no-tags | |
- name: Clone device spec source | |
run: | | |
source halium.env | |
git clone https://github.com/ubports-on-vince/device_xiaomi_vince.git $ANDROID_ROOT/device/xiaomi/vince --depth=1 | |
git clone https://github.com/ubports-on-vince/vendor_xiaomi_vince.git $ANDROID_ROOT/vendor/xiaomi/vince --depth=1 | |
rm -rf $ANDROID_ROOT/halium/hybris-boot | |
git clone https://github.com/Sailfish-On-Vince/hybris-boot.git $ANDROID_ROOT/halium/hybris-boot | |
git clone https://github.com/ubports-on-vince/Xiaomi_Kernel_OpenSource.git -b tiffany-n-oss $ANDROID_ROOT/kernel/xiaomi/msm8953 --depth=1 | |
git clone https://android.googlesource.com/platform/external/curl.git -b android-7.1.2_r37 $ANDROID_ROOT/external/libcurl --depth=1 | |
- name: Build HAL | |
run: | | |
chmod +x build-hal.sh | |
bash -x build-hal.sh | |
shell: bash | |
- name: Build Package | |
run: | | |
chmod +x package.sh | |
bash -x package.sh | |
shell: bash | |
- name: Upload flashable zip | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{env.FLASHABLE_DIR}}.zip | |
path: /home/runner/work/${{env.FLASHABLE_DIR}}.zip |