Build SailfishOS dhd-sagit #2
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 Android HAL and dhd packages using GitHub Actions | |
# Lisence: MIT | |
# Author: 0312birdzhang | |
#================================================= | |
name: Build SailfishOS dhd-sagit | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
env: | |
DEVICE: sagit | |
VENDOR: xiaomi | |
ANDROID_ROOT: /home/runner/work/hadk_16.0/ | |
SAILFISH_SKD_VERSION: 3.3.0.16 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Initialization environment | |
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 lib32ncurses5-dev \ | |
lib32readline-dev lib32z1-dev libesd0-dev liblz4-tool \ | |
libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev \ | |
libxml2 libxml2-utils lzop pngcrush rsync schedtool \ | |
squashfs-tools xsltproc yasm zip zlib1g-dev git | |
- name: Download repo bin file | |
run: | | |
mkdir -p ~/bin | |
wget 'https://storage.googleapis.com/git-repo-downloads/repo' -P ~/bin | |
chmod +x ~/bin/repo | |
git config --global user.name "Verevka" | |
git config --global user.email "[email protected]" | |
- name: Downloading source code | |
run: | | |
source hadk.env | |
mkdir -p $ANDROID_ROOT | |
cd $ANDROID_ROOT | |
repo init -u git://github.com/SailfishOS-sagit/android -b hybris-16.0 --depth=1 --no-repo-verify | |
repo sync --fetch-submodules --force-sync -c --no-clone-bundle --no-tags | |
- name: Clone device spec source | |
run: | | |
source hadk.env | |
git clone https://github.com/SailfishOS-sagit/android_device_xiaomi_sagit.git $ANDROID_ROOT/device/xiaomi/sagit -b lineage-16.0 --depth=1 | |
git clone https://github.com/SailfishOS-sagit/android_device_xiaomi_msm8998-common.git $ANDROID_ROOT/device/xiaomi/msm8998-common -b hybris-16.0 --depth=1 | |
git clone https://github.com/SailfishOS-sagit/android_kernel_xiaomi_msm8998.git $ANDROID_ROOT/kernel/xiaomi/msm8998 -b ubports --depth=1 | |
rm -rf $ANDROID_ROOT/hybris/hybris-boot | |
git clone https://github.com/SailfishOS-sagit/hybris-boot.git $ANDROID_ROOT/hybris/hybris-boot -b master | |
git clone https://github.com/SailfishOS-sagit/android_vendor_xiaomi.git $ANDROID_ROOT/vendor/xiaomi -b lineage-16.0 | |
rm -rf $ANDROID_ROOT/vendor/lineage | |
git clone https://github.com/SailfishOS-sagit/android_vendor_lineage.git $ANDROID_ROOT/vendor/lineage -b lineage-16.0 | |
git clone https://github.com/SailfishOS-sagit/hybris-installer.git $ANDROID_ROOT/hybris/hybris-installer -b master | |
git clone https://github.com/piggz/sailfish-fpd-community.git $ANDROID_ROOT/hybris/mw/sailfish-fpd-community -b master | |
git clone https://github.com/SailfishOS-sagit/erfanoabdi/fake_crypt.git $ANDROID_ROOT/external/fake_crypt -b master | |
git clone --recurse-submodules https://github.com/SailfishOS-sagit/droid-hal-sagit.git $ANDROID_ROOT/rpm -b 3.3.0.16 | |
git clone --recurse-submodules https://github.com/SailfishOS-sagit/droid-config-sagit.git $ANDROID_ROOT/hybris/droid-configs -b 3.3.0.16 | |
git clone --recurse-submodules https://github.com/SailfishOS-sagit/droid-hal-version-sagit.git $ANDROID_ROOT/hybris/droid-hal-version-sagit -b 3.3.0.16 | |
rm -rf $ANDROID_ROOT/external/droidmedia | |
git clone https://github.com/sailfishos/droidmedia.git $ANDROID_ROOT/external/droidmedia | |
- name: Build HAL | |
run: | | |
chmod +x build-hal.sh | |
bash build-hal.sh | |
shell: bash | |
- name: Build dhd in container | |
run: | | |
echo "clean more folders" | |
rm -rf $ANDROID_ROOT/prebuilts $ANDROID_ROOT/external/chromium* $ANDROID_ROOT/tools/external/gradle $ANDROID_ROOT/packages | |
rm -rf $ANDROID_ROOT/out/build-lineage_sagit.ninja || true | |
rm -rf $ANDROID_ROOT/out/soong | |
chmod +x build-rpm.sh | |
sudo docker images|grep -v REPOSITORY|awk '{print $3}'|xargs docker rmi | |
sudo docker pull coderus/sailfishos-platform-sdk:$SAILFISH_SKD_VERSION | |
sudo docker run -v /home/runner/work:/home/nemo/work coderus/sailfishos-platform-sdk:$SAILFISH_SKD_VERSION /bin/sh /home/nemo/work/ci/ci/build-rpm.sh | |
shell: bash | |
- name: Check free disk | |
if: failure() | |
run: | | |
df -h | |
shell: bash | |
- name : Upload boot image | |
uses: actions/upload-artifact@master | |
with: | |
name: hybris-boot.img | |
path: ${{env.ANDROID_ROOT}}/out/target/product/${{env.DEVICE}}/hybris-boot.img | |
- name : Upload install zip arhive | |
uses: actions/upload-artifact@master | |
with: | |
name: sailfishos-3.3.0.16-sagit-Verevka.zip | |
path: ${{env.ANDROID_ROOT}}/SailfishOScommunity-release-3.3.0.16-sagit-Verevka/sailfishos-3.3.0.16-sagit-Verevka.zip |