Update runner #25
This file contains hidden or 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: Run on .config or kernel-url Change | |
on: | |
push: | |
paths: | |
- "runner" | |
jobs: | |
process-config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log Change | |
run: | | |
echo "runner has been modified. Processing changes..." | |
- name: Install wget and dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y wget tar libncurses-dev bison flex libssl-dev libelf-dev bc zstd unzip rsync | |
# Cache the 'kext' directory to avoid re-downloading kernel on each run | |
- name: Cache kernel source | |
uses: actions/[email protected] | |
with: | |
path: kext/ | |
key: ${{ runner.os }}-kext-${{ hashFiles('kernel-url') }} | |
restore-keys: | | |
${{ runner.os }}-kext- | |
# Download, extract, and build kernel, always running make | |
- name: Download, extract, and build kernel | |
run: | | |
# Download the kernel source only if it's not cached | |
if [ ! -d "kext" ]; then | |
wget -q -i kernel-url -O kernel.tar.xz | |
mkdir -p kext | |
tar -xf kernel.tar.xz -C kext --strip-components=1 | |
fi | |
# Copy the .config file and update configuration | |
cp .config kext/ | |
# copy firmware if necessary | |
if [ ! -f "fw" ]; then | |
rsync -av fw kext/ | |
fi | |
cd kext | |
# Run make every time, even if cached | |
make -j$(nproc) | |
# Upload the kernel artifact | |
- name: Upload kernel | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kernel-bzImage | |
path: kext/arch/x86/boot/bzImage |