Skip to content

LineageOS CI (SM-J320FN) #18

LineageOS CI (SM-J320FN)

LineageOS CI (SM-J320FN) #18

name: LineageOS CI (SM-J320FN)
on:
workflow_dispatch:
jobs:
build:
name: LineageOS Build CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
steps:
- name: Check Out
uses: actions/checkout@v3
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Installing JDK 7 + Build Dependencies
run: |
sudo apt-get update
sudo apt-get install gperf gcc-multilib maven gcc-10-multilib g++-multilib g++-10-multilib libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc bc ccache lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk3.0-gtk3-dev libxml2 lzop pngcrush schedtool squashfs-tools imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libncurses5 axel python
- name: Install OpenJDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Syncing LineageOS sources
run: |
mkdir ~/TWRP
cd ~/TWRP
mkdir ~/.bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo
python3 ~/.bin/repo init --depth=1 -u https://github.com/LineageOS/android.git -b cm-14.1
git clone https://github.com/djeman/android_device_samsung_j3xnlte -b cm-14.1 ~/TWRP/device/samsung/j3xnlte
git clone https://github.com/djeman/android_device_samsung_sharkls-common -b cm-14.1 ~/TWRP/device/samsung/sharkls-common
git clone https://github.com/j3xlte-dev/android_kernel_samsung_sharkls -b cm-14.1 ~/TWRP/kernel/samsung/sharkls
git clone https://github.com/djeman/android_vendor_samsung_common -b cm-14.1 ~/TWRP/vendor/samsung/common
git clone https://github.com/djeman/android_vendor_sprd -b cm-14.1 ~/TWRP/vendor/sprd
git clone https://github.com/LineageOS/android_vendor_nxp-nfc_opensource_libnfc-nci -b cm-14.1 ~/TWRP/vendor/nxp-nfc/opensource/libnfc-nci
git clone https://github.com/LineageOS/android_vendor_nxp-nfc_opensource_frameworks -b cm-14.1 ~/TWRP/vendor/nxp-nfc/opensource/frameworks
git clone https://github.com/LineageOS/android_vendor_nxp-nfc_opensource_Nfc -b cm-14.1 ~/TWRP/vendor/nxp-nfc/opensource/Nfc
git clone https://github.com/LineageOS/android_external_busybox -b cm-14.1 ~/TWRP/external/busybox
git clone https://github.com/LineageOS/android_hardware_samsung -b cm-14.1 ~/TWRP/hardware/samsung
git clone https://github.com/LineageOS/android_external_stlport -b cm-14.1 ~/TWRP/external/stlport
git clone https://github.com/LineageOS/android_external_sony_boringssl-compat -b cm-14.1 ~/TWRP/external/sony/boringssl-compat
git clone https://github.com/TeamWin/android_bootable_recovery -b android-7.1 ~/TWRP/bootable/recovery-twrp
git clone https://github.com/LineageOS/android_packages_apps_SamsungServiceMode -b cm-14.1 ~/TWRP/packages/apps/SamsungServiceMode
git clone --depth 1 --branch android-7.1.2_r12 --single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8 /opt/toolchains/arm-eabi-4.8/
python3 ~/.bin/repo sync -c --force-sync --optimized-fetch --no-tags --no-clone-bundle --prune -j$(nproc --all)
- name: Applying patches for LineageOS
run: |
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/bootable_recovery-twrp.diff ~/TWRP/bootable/recovery-twrp
cd ~/TWRP/bootable/recovery-twrp
patch -p1 < bootable_recovery-twrp.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/external_tinyalsa.diff ~/TWRP/external/tinyalsa
cd ~/TWRP/external/tinyalsa
patch -p1 < external_tinyalsa.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/frameworks_av.diff ~/TWRP/frameworks/av
cd ~/TWRP/frameworks/av
patch -p1 < frameworks_av.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/frameworks_base.diff ~/TWRP/frameworks/base
cd ~/TWRP/frameworks/base
patch -p1 < frameworks_base.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/frameworks_native.diff ~/TWRP/frameworks/native
cd ~/TWRP/frameworks/native
patch -p1 < frameworks_native.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/frameworks_opt.diff ~/TWRP/frameworks/opt
cd ~/TWRP/frameworks/opt
patch -p1 < frameworks_opt.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/hardware_libhardware.diff ~/TWRP/hardware/libhardware
cd ~/TWRP/hardware/libhardware
patch -p1 < hardware_libhardware.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/hardware_libhardware_legacy.diff ~/TWRP/hardware/libhardware_legacy
cd ~/TWRP/hardware/libhardware_legacy
patch -p1 < hardware_libhardware_legacy.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/packages_apps.diff ~/TWRP/packages/apps
cd ~/TWRP/packages/apps
patch -p1 < packages_apps.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/system_bt.diff ~/TWRP/system/bt
cd ~/TWRP/system/bt
patch -p1 < system_bt.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/system_core.diff ~/TWRP/system/core
cd ~/TWRP/system/core
patch -p1 < system_core.diff
mv ~/TWRP/device/samsung/sharkls-common/patches/sprd-diff/system_media.diff ~/TWRP/system/media
cd ~/TWRP/system/media
patch -p1 < system_media.diff
- name: Making up space
run: |
sudo apt-get clean
journalctl --disk-usage
sudo journalctl --vacuum-time=3d
sudo rm -rf ~/.cache/thumbnails/*
sudo apt-get autoremove --purge
- name: Building LineageOS
run: |
cd ~/TWRP
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
source build/envsetup.sh
export RECOVERY_VARIANT=twrp
export ARCH=arm
export KBUILD_BUILD_USER=notnoelchannel
export KBUILD_BUILD_HOST=unlegacy-devices
export CROSS_COMPILE=/opt/toolchains/arm-eabi-4.8/bin/arm-eabi-
export ALLOW_MISSING_DEPENDENCIES=true
export LC_ALL=C
lunch lineage_j3xnlte-userdebug
make -j$(nproc --all) otapackage
- name: Uploading LineageOS builds
uses: actions/upload-artifact@v2
with:
name: lineageos
path: /home/runner/TWRP/out/target/product/j3xnlte/*.zip
- name: Uploading LineageOS Recovery builds
uses: actions/upload-artifact@v2
with:
name: lineagerecovery
path: /home/runner/TWRP/out/target/product/j3xnlte/recovery.*