Build release #19
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
name: Build release | |
on: | |
workflow_dispatch: | |
jobs: | |
build_squeak: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [SM-A546E, SM-A546B] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- uses: rokibhasansagar/slimhub_actions@main | |
- name: Set up build environment | |
run: | | |
sudo apt update && sudo apt upgrade | |
sudo apt autoremove -y | |
sudo apt install -yq tar \ | |
attr libelf-dev dwarves rsync libbrotli-dev \ | |
libgtest-dev libprotobuf-dev libunwind-dev libusb-1.0-0-dev libzstd-dev libc6-dev \ | |
linux-modules-extra-$(uname -r) build-essential p7zip-full libarchive-tools | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Fetch ToolChain | |
run: | | |
mkdir -p ~/Prebuilts | |
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 ~/Prebuilts/gl-clang | |
rm -rf ~/Prebuilts/gl-clang/clang-3* ~/Prebuilts/gl-clang/clang-r4* ~/Prebuilts/gl-clang/clang-r51* ~/Prebuilts/gl-clang/.git | |
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ~/Prebuilts/gas/linux-x86 | |
rm -rf ~/Prebuilts/gas/linux-x86/.git | |
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/build-tools ~/Prebuilts/build-tools | |
rm -rf ~/Prebuilts/build-tools/.git | |
- name: Fetch AnyKernel3 | |
run: | | |
git clone --branch a54x https://github.com/Vaz15k/AnyKernel3.git ~/AnyKernel3 | |
mkdir -p ~/files | |
- name: Set date variable | |
id: date | |
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Fetch Magiskboot and KSUD tools | |
run: | | |
mkdir -p ~/bin | |
# Set MagiskBoot | |
curl https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Tools/magiskboot -o ~/bin/magiskboot | |
if [[ -f ~/bin/magiskboot ]]; then | |
chmod a+x ~/bin/magiskboot | |
sudo ln -sf ~/bin/magiskboot /usr/bin/magiskboot | |
else | |
echo "magiskboot not found" | |
exit 1 | |
fi | |
# Set KSUD | |
curl https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Tools/ksud -o ~/bin/ksud | |
if [[ -f ~/bin/ksud ]]; then | |
chmod a+x ~/bin/ksud | |
sudo ln -sf ~/bin/ksud /usr/bin/ksud | |
else | |
echo "KSUD not found" | |
exit 1 | |
fi | |
- name: Download Images | |
run: | | |
mkdir -p ~/mkboot | |
# Download boot.img | |
curl --retry 5 --retry-delay 5 https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/${{ matrix.target }}/boot.img -o ~/mkboot/boot_${{ matrix.target }}.img | |
if [[ -f ~/mkboot/boot_${{ matrix.target }}.img ]]; then | |
echo "Everything OK" | |
else | |
echo "boot not found" | |
exit 1 | |
fi | |
# Download init_boot.img | |
curl --retry 5 --retry-delay 5 https://raw.githubusercontent.com/Vaz15k/literate-potato/master/Imagens/${{ matrix.target }}/init_boot.img -o ~/mkboot/init_boot_${{ matrix.target }}.img | |
if [[ -f ~/mkboot/init_boot_${{ matrix.target }}.img ]]; then | |
echo "Everything OK" | |
else | |
echo "init_boot not found" | |
exit 1 | |
fi | |
- name: Build Kernel Clean | |
run: | | |
./build_kernel.sh ${{ matrix.target }} | |
cp ~/AnyKernel3/Squeak* ~/files | |
- name: Create LKM Kernel | |
run: | | |
cp ~/AnyKernel3/Image ~/mkboot/kernel | |
cd ~/mkboot | |
echo "Repacking boot image..." | |
magiskboot repack boot_${{ matrix.target }}.img boot.img | |
ksud boot-patch -b init_boot_${{ matrix.target }}.img --kmi android13-5.15 --magiskboot ~/bin/magiskboot | |
mv kernelsu* init_boot.img | |
echo "Checking existence of images..." | |
if [[ -f "boot.img" && -f "init_boot.img" ]]; then | |
echo "Creating tar archive..." | |
tar -cf Squeak_KSU-LKM_${{ matrix.target }}_${{ env.DATE }}.tar boot.img init_boot.img | |
else | |
echo "Error: One or both images not found!" | |
exit 1 | |
fi | |
mv Squeak* ~/files | |
echo "Completed successfully." | |
- name: Build Kernel With KSU | |
run: | | |
rm -rf ~/mkboot | |
./build_kernel.sh ${{ matrix.target }} --ksu | |
cp ~/AnyKernel3/Squeak* ~/files | |
- name: Publish to GitHub | |
id: release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: /home/runner/files/Squeak* | |
name: Squeak Kernel - ${{ env.DATE }} | |
tag_name: "${{ env.DATE }}" | |
body: | | |
- **Kernel Version:** 5.15.123 | |
- **Clang Version:** Clang-r522817 | |
:rocket: *Built with love by GitHub Actions.* | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} |