Skip to content

LineageOS

LineageOS #4

Workflow file for this run

name: LineageOS
on:
workflow_dispatch:
inputs:
MANIFEST_BRANCH:
description: 'LineageOs Manifest Branch'
required: true
default: ''
type: choice
options:
- lineage-20.0
- lineage-19.1
- lineage-19.0
- lineage-18.1
- lineage-18.0
- lineage-17.1
jobs:
build:
name: Build LineageOS by ${{ github.actor }}
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- name: Check Out
uses: actions/checkout@v4
- name: Display Inputs
run: |
echo "Displaying variables/inputs."
echo "Manifest Branch: ${{ inputs.MANIFEST_BRANCH }}"
echo "Device Tree: ${{ inputs.DEVICE_TREE }}"
echo "Device Branch: ${{ inputs.DEVICE_TREE_BRANCH }}"
echo "Build Target: ${{ inputs.BUILD_TARGET }}"
- name: Cleanup
uses: rokibhasansagar/slimhub_actions@main
- name: Check Manifest Branch
run: |
if [ ${{ inputs.MANIFEST_BRANCH }} == 'android-11.0' ] || [ ${{ inputs.MANIFEST_BRANCH }} == 'android-12.1' ]; then
echo "CHECK_LEGACY_BRANCH=false" >> $GITHUB_ENV
else
echo "CHECK_LEGACY_BRANCH=true" >> $GITHUB_ENV
fi
- name: Prepare the environment
run: |
sudo apt update
sudo apt -y upgrade
sudo apt -y install gperf gcc-multilib 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 libtinfo5 libgflags-dev libncurses5 python3 bison g++-multilib git gperf libxml2-utils make zip liblz4-tool libssl-dev bc flex curl python-is-python3
- name: Install OpenJDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Install Git-Repo
run: |
mkdir ~/bin
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
sudo ln -sf ~/bin/repo /usr/bin/repo
- name: Initialize Repo
run: |
mkdir android-build
cd android-build
git config --global user.name "onesmiledx"
git config --global user.email "[email protected]"
repo init --depth=1 -u https://github.com/LineageOS/android.git -b ${{ inputs.MANIFEST_BRANCH }}
- name: Repo Sync
run: |
cd android-build
repo sync -j$(nproc --all) --force-sync --no-tags
- name: Clone Device Tree
run: |
rm -rf .repo
cd android-build
git clone https://github.com/onesmiledx/android_device_samsung_a10s device/samsung/a10s
git clone https://github.com/onesmiledx/android_vendor_samsung_a10s vendor/samsung/a10s
- name: Installing python2 for legacy builds
if: env.CHECK_LEGACY_BRANCH == 'true'
run: |
sudo apt-get install python2 python-is-python2
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 12
- name: Building LineageOS
run: |
cd android-build
source build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
lunch lineage_a10s-eng && mka bacon -j16
- name: Set Build Date # Output will be use in Release
run: |
echo "BUILD_DATE=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Upload to Release
uses: softprops/action-gh-release@master
with:
files: |
android-recovery/out/target/product/a10s/lineage*.zip
name: Unofficial LineageOS for ${{ env.DEVICE_NAME }} // ${{ env.BUILD_DATE }}
tag_name: ${{ github.run_id }}
body: |
Build: ${{ inputs.MANIFEST_BRANCH }}
Device: Samsung Galaxy A10s
Commit: Most recent [commit](${{ inputs.DEVICE_TREE }}/commit/${{ env.COMMIT_ID }}) during building.