|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + workflow_dispatch: |
| 9 | + inputs: |
| 10 | + mode: |
| 11 | + description: "Patch blend mode" |
| 12 | + required: false |
| 13 | + default: hybrid |
| 14 | + type: choice |
| 15 | + options: [hybrid, xanmod, liquorix, auto] |
| 16 | + branch: |
| 17 | + description: "XanMod branch" |
| 18 | + required: false |
| 19 | + default: MAIN |
| 20 | + type: choice |
| 21 | + options: [MAIN, EDGE, LTS, RT] |
| 22 | + |
| 23 | +jobs: |
| 24 | + shellcheck: |
| 25 | + name: Shellcheck |
| 26 | + runs-on: ubuntu-latest |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v4 |
| 29 | + - name: Install shellcheck |
| 30 | + run: sudo apt-get install -y shellcheck |
| 31 | + - name: Lint |
| 32 | + run: | |
| 33 | + find . -name '*.sh' ! -path './.cache/*' ! -path './kernel/src/*' \ |
| 34 | + -exec shellcheck -x -S warning {} + |
| 35 | +
|
| 36 | + build-matrix: |
| 37 | + name: Build (${{ matrix.distro }} / ${{ matrix.mode }}) |
| 38 | + runs-on: ubuntu-latest |
| 39 | + needs: shellcheck |
| 40 | + strategy: |
| 41 | + fail-fast: false |
| 42 | + matrix: |
| 43 | + include: |
| 44 | + # Hybrid mode — the primary deliverable |
| 45 | + - distro: debian |
| 46 | + release: bookworm |
| 47 | + mode: hybrid |
| 48 | + branch: MAIN |
| 49 | + - distro: arch |
| 50 | + release: "" |
| 51 | + mode: hybrid |
| 52 | + branch: MAIN |
| 53 | + - distro: fedora |
| 54 | + release: "42" |
| 55 | + mode: hybrid |
| 56 | + branch: MAIN |
| 57 | + # XanMod-only (server profile) |
| 58 | + - distro: debian |
| 59 | + release: bookworm |
| 60 | + mode: xanmod |
| 61 | + branch: LTS |
| 62 | + # Liquorix-only (RT profile) |
| 63 | + - distro: debian |
| 64 | + release: bookworm |
| 65 | + mode: liquorix |
| 66 | + branch: RT |
| 67 | + |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Install build dependencies |
| 72 | + run: | |
| 73 | + sudo apt-get update -qq |
| 74 | + sudo apt-get install -y --no-install-recommends \ |
| 75 | + build-essential bc bison flex libssl-dev libelf-dev \ |
| 76 | + libncurses-dev dwarves pahole curl git jq \ |
| 77 | + shellcheck |
| 78 | +
|
| 79 | + - name: Fetch XanMod source |
| 80 | + run: bash kernel/fetch.sh ${{ matrix.branch }} |
| 81 | + env: |
| 82 | + XANMOD_NO_API: "0" |
| 83 | + |
| 84 | + - name: Resolve Liquorix version |
| 85 | + id: lqx_ver |
| 86 | + run: | |
| 87 | + kmaj=$(make -s -C kernel/src kernelversion 2>/dev/null \ |
| 88 | + | grep -oE '^[0-9]+\.[0-9]+' || true) |
| 89 | + ver=$(bash scripts/resolve-lqx-version.sh "${kmaj}") |
| 90 | + echo "version=${ver}" >> "$GITHUB_OUTPUT" |
| 91 | +
|
| 92 | + - name: Fetch Liquorix patches |
| 93 | + if: matrix.mode != 'xanmod' |
| 94 | + run: bash scripts/fetch-lqx-patches.sh "${{ steps.lqx_ver.outputs.version }}" |
| 95 | + |
| 96 | + - name: Apply patches |
| 97 | + run: | |
| 98 | + bash scripts/apply-patches.sh kernel/src patches |
| 99 | + env: |
| 100 | + MODE: ${{ matrix.mode }} |
| 101 | + ENABLE_ZEN_PATCHES: ${{ matrix.mode != 'xanmod' && '1' || '0' }} |
| 102 | + ENABLE_LQX_PATCHES: ${{ matrix.mode != 'xanmod' && '1' || '0' }} |
| 103 | + ENABLE_NET_PATCHES: "1" |
| 104 | + LQX_VER: ${{ steps.lqx_ver.outputs.version }} |
| 105 | + |
| 106 | + - name: Inject autodetect module |
| 107 | + if: matrix.mode == 'hybrid' || matrix.mode == 'auto' |
| 108 | + run: bash scripts/inject-autodetect.sh kernel/src |
| 109 | + |
| 110 | + - name: Merge config fragments |
| 111 | + run: | |
| 112 | + REPO_ROOT="${PWD}" |
| 113 | + MERGE="${REPO_ROOT}/kernel/src/scripts/kconfig/merge_config.sh" |
| 114 | + FRAGS=("${REPO_ROOT}/configs/base/x86-64-v2.config") |
| 115 | + case "${{ matrix.mode }}" in |
| 116 | + xanmod) FRAGS+=("${REPO_ROOT}/configs/features/xanmod.config") ;; |
| 117 | + liquorix) FRAGS+=("${REPO_ROOT}/configs/features/liquorix.config") ;; |
| 118 | + hybrid|auto) |
| 119 | + FRAGS+=("${REPO_ROOT}/configs/features/xanmod.config") |
| 120 | + FRAGS+=("${REPO_ROOT}/configs/features/liquorix.config") |
| 121 | + FRAGS+=("${REPO_ROOT}/configs/features/hybrid.config") |
| 122 | + ;; |
| 123 | + esac |
| 124 | + FRAGS+=("${REPO_ROOT}/configs/features/no-debug.config") |
| 125 | + cd kernel/src |
| 126 | + bash "${MERGE}" -m .config "${FRAGS[@]}" |
| 127 | + make ARCH=x86 olddefconfig |
| 128 | +
|
| 129 | + - name: Build kernel (allmodconfig smoke test) |
| 130 | + run: | |
| 131 | + cd kernel/src |
| 132 | + make -j"$(nproc)" ARCH=x86 bzImage |
| 133 | + timeout-minutes: 90 |
| 134 | + |
| 135 | + - name: Upload bzImage artifact |
| 136 | + uses: actions/upload-artifact@v4 |
| 137 | + with: |
| 138 | + name: bzImage-${{ matrix.mode }}-${{ matrix.branch }}-${{ matrix.distro }} |
| 139 | + path: kernel/src/arch/x86/boot/bzImage |
| 140 | + if-no-files-found: error |
| 141 | + |
| 142 | + release: |
| 143 | + name: Release |
| 144 | + runs-on: ubuntu-latest |
| 145 | + needs: build-matrix |
| 146 | + if: github.ref == 'refs/heads/main' && github.event_name == 'push' |
| 147 | + steps: |
| 148 | + - uses: actions/checkout@v4 |
| 149 | + - name: Download all artifacts |
| 150 | + uses: actions/download-artifact@v4 |
| 151 | + with: |
| 152 | + path: artifacts/ |
| 153 | + - name: Create release |
| 154 | + uses: softprops/action-gh-release@v2 |
| 155 | + with: |
| 156 | + tag_name: "build-${{ github.run_number }}" |
| 157 | + name: "LiqXanMod build ${{ github.run_number }}" |
| 158 | + files: artifacts/**/* |
| 159 | + generate_release_notes: true |
0 commit comments