|
| 1 | +name: BasicallyLinux ISO Build Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build Bootable ISO |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout Code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Install Toolchain & ISO Tools |
| 19 | + run: | |
| 20 | + sudo apt-get update |
| 21 | + sudo apt-get install -y \ |
| 22 | + nasm \ |
| 23 | + make \ |
| 24 | + cmake \ |
| 25 | + binutils-i686-linux-gnu \ |
| 26 | + gcc-i686-linux-gnu \ |
| 27 | + libgcc-s1-i386-cross \ |
| 28 | + wget \ |
| 29 | + grub-pc-bin \ |
| 30 | + xorriso \ |
| 31 | + mtools |
| 32 | +
|
| 33 | + - name: Cache AI Model |
| 34 | + id: cache-model |
| 35 | + uses: actions/cache@v4 |
| 36 | + with: |
| 37 | + path: assets/smollm2.gguf |
| 38 | + key: ${{ runner.os }}-model-smollm2 |
| 39 | + |
| 40 | + - name: Download AI Model Asset |
| 41 | + if: steps.cache-model.outputs.cache-hit != 'true' |
| 42 | + run: | |
| 43 | + mkdir -p assets |
| 44 | + wget -O assets/smollm2.gguf https://huggingface.co/bartowski/SmolLM2-135M-Instruct-GGUF/resolve/main/SmolLM2-135M-Instruct-Q4_K_M.gguf |
| 45 | +
|
| 46 | + - name: Build BasicallyLinux Kernel |
| 47 | + run: | |
| 48 | + mkdir -p build |
| 49 | + cd build |
| 50 | + cmake .. \ |
| 51 | + -DCMAKE_C_COMPILER=i686-linux-gnu-gcc \ |
| 52 | + -DCMAKE_ASM_NASM_COMPILER=nasm \ |
| 53 | + -DCMAKE_ASM_NASM_FLAGS="-f elf32" \ |
| 54 | + -DCMAKE_C_FLAGS="-m32" \ |
| 55 | + -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY |
| 56 | + make |
| 57 | +
|
| 58 | + - name: Create ISO Structure |
| 59 | + run: | |
| 60 | + mkdir -p isodir/boot/grub |
| 61 | + cp build/kernel.bin isodir/boot/kernel.bin |
| 62 | + # Optional: Put the AI model inside the ISO as a multiboot module |
| 63 | + cp assets/smollm2.gguf isodir/boot/smollm2.gguf |
| 64 | + |
| 65 | + # Generate GRUB configuration |
| 66 | + cat << 'EOF' > isodir/boot/grub/grub.cfg |
| 67 | + set timeout=0 |
| 68 | + set default=0 |
| 69 | + menuentry "BasicallyLinux" { |
| 70 | + multiboot /boot/kernel.bin |
| 71 | + module /boot/smollm2.gguf "ai_model" |
| 72 | + boot |
| 73 | + } |
| 74 | + EOF |
| 75 | +
|
| 76 | + - name: Generate Bootable ISO |
| 77 | + run: | |
| 78 | + grub-mkrescue -o basicallylinux.iso isodir |
| 79 | +
|
| 80 | + - name: Archive ISO Artifact |
| 81 | + if: success() |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: basicallylinux-bootable-iso |
| 85 | + path: basicallylinux.iso |
0 commit comments