Update ISO.yml #2
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: BasicallyLinux ISO Build Pipeline | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| name: Build Bootable ISO | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Install Toolchain & ISO Tools | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| nasm make cmake wget xorriso grub-pc-bin mtools \ | |
| binutils-i686-linux-gnu gcc-i686-linux-gnu | |
| - name: Download AI Model Asset | |
| run: | | |
| mkdir -p assets | |
| # Using a small model for faster CI builds | |
| wget -O assets/smollm2.gguf https://huggingface.co/bartowski/SmolLM2-135M-Instruct-GGUF/resolve/main/SmolLM2-135M-Instruct-Q4_K_M.gguf | |
| - name: Build BasicallyLinux Kernel | |
| run: | | |
| mkdir -p build | |
| cd build | |
| # -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY prevents CMake from | |
| # failing because it can't run a test program (since it's a kernel) | |
| cmake .. \ | |
| -DCMAKE_C_COMPILER=i686-linux-gnu-gcc \ | |
| -DCMAKE_ASM_NASM_COMPILER=nasm \ | |
| -DCMAKE_ASM_NASM_FLAGS="-f elf32" \ | |
| -DCMAKE_C_FLAGS="-m32 -ffreestanding -fno-stack-protector" \ | |
| -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY | |
| make VERBOSE=1 | |
| - name: Verify Multiboot Header (CRITICAL) | |
| run: | | |
| # This tool checks if GRUB can actually find the header in the bin file | |
| if grub-file --is-x86-multiboot build/kernel.bin; then | |
| echo "✅ Multiboot header found and valid!" | |
| else | |
| echo "❌ ERROR: No Multiboot header found in kernel.bin" | |
| echo "Check that .multiboot section is at the start of your linker script." | |
| exit 1 | |
| fi | |
| - name: Prepare ISO Directory | |
| run: | | |
| mkdir -p isodir/boot/grub | |
| cp build/kernel.bin isodir/boot/kernel.bin | |
| cp assets/smollm2.gguf isodir/boot/smollm2.gguf | |
| # Create a bulletproof grub.cfg | |
| cat << 'EOF' > isodir/boot/grub/grub.cfg | |
| set timeout=5 | |
| set default=0 | |
| menuentry "BasicallyLinux Alpha" { | |
| multiboot /boot/kernel.bin | |
| module /boot/smollm2.gguf "ai_model" | |
| boot | |
| } | |
| EOF | |
| - name: Generate Bootable ISO | |
| run: | | |
| # grub-mkrescue creates the actual bootable image | |
| grub-mkrescue -o basicallylinux.iso isodir | |
| - name: Archive ISO Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: basicallylinux-bootable-iso | |
| path: basicallylinux.iso |