Skip to content

use depth=1

use depth=1 #5

Workflow file for this run

name: ramdisk
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- device: m21
name: "🚧 Build for ${{matrix.device}}"
steps:
- name: Set up RAM disk
run: |
sudo mkdir -p /mnt/ramdisk
sudo mount -t tmpfs -o size=4G tmpfs /mnt/ramdisk
sudo chown -R $USER:$USER /mnt/ramdisk
- name: Extract branch name
id: extract_branch
run: |
if [[ "$GITHUB_REF" == "refs/heads/"* ]]; then
BRANCH_NAME=${GITHUB_REF#refs/heads/}
elif [[ "$GITHUB_REF" == "refs/pull/"* ]]; then
BRANCH_NAME=${GITHUB_HEAD_REF}
else
BRANCH_NAME=${GITHUB_REF}
fi
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Checkout source
run: |
git clone --depth=1 --branch $BRANCH_NAME $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git /mnt/ramdisk/repo
env:
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
BRANCH_NAME: ${{ env.BRANCH_NAME }}
- uses: szenius/[email protected]
with:
timezoneLinux: "Asia/Kolkata"
- name: Setup Toolchains
run: |
cd /mnt/ramdisk/repo
ls
sudo apt update
sudo apt install bison flex libssl-dev python3 python-is-python3 libarchive-tools -y
mkdir -p toolchain
cd toolchain
echo 'Download antman and sync'
bash <(curl -s "https://raw.githubusercontent.com/Neutron-Toolchains/antman/main/antman") -S=05012024
echo 'Patch for glibc'
bash <(curl -s "https://raw.githubusercontent.com/Neutron-Toolchains/antman/main/antman") --patch=glibc
echo 'Done'
- name: Run build
run: |
DEVICE=${{matrix.device}} KSU=1 ./build.sh
- name: Upload kernel
uses: actions/upload-artifact@v4
with:
name: N_kernel-${{matrix.device}}_Clang_18
path: /mnt/ramdisk/repo/AnyKernel3/N*.zip
- name: Upload to Telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
document: /mnt/ramdisk/repo/AnyKernel3/N*.zip
message: "Build COmpleted"