Update main.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: CD | |
| on: | |
| push: | |
| branches: sequoia15-dev | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| BUILD_OUTPUT: 'build/Build/Products/Debug' | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '5' | |
| submodules: recursive | |
| - name: Manage Version | |
| run: | | |
| git fetch --prune --unshallow --tags | |
| GIT_SHA="$(git rev-parse --short HEAD)" | |
| eval $(grep -m 1 "MODULE_VERSION =" itlwm.xcodeproj/project.pbxproj | tr -d ';' | tr -d '\t' | tr -d " ") | |
| echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV | |
| echo "ITLWM_VER=$MODULE_VERSION" >> $GITHUB_ENV | |
| - name: Install MacKernelSDK | |
| run: | | |
| git clone --depth=1 https://github.com/acidanthera/MacKernelSDK.git | |
| # Apply Sequoia 15.7 IONetworkController vtable fix (slots 6 and 7 | |
| # are real methods, not RESERVED, in 15.7+). Patch is gated on | |
| # __IO80211_TARGET >= __MAC_15_0 so Sonoma/Ventura/etc. builds are | |
| # binary-identical. See patches/0001-* for the full rationale. | |
| ( cd MacKernelSDK && patch -p1 < ../patches/0001-IONetworkController-sequoia-slots-6-7.patch ) | |
| - name: Build itlwm | |
| run: | | |
| xcodebuild -scheme itlwm -configuration Debug -derivedDataPath build GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]} | |
| - name: Build AirportItlwm | |
| run: | | |
| xcodebuild -scheme "AirportItlwm (all)" -configuration Debug -derivedDataPath build GIT_COMMIT=_${SHORT_SHA} | xcpretty && exit ${PIPESTATUS[0]} | |
| - name: Build AirportItlwm-Sequoia15 | |
| run: | | |
| # OTHER_LDFLAGS=-no_zero_fill_sections forces ld64 to materialise | |
| # __DATA __bss / __common as real (zeroed) bytes in the file rather | |
| # than declaring them with S_ZEROFILL. Without this, the on-disk | |
| # __DATA filesize is smaller than vmsize, which makes the | |
| # __LINKEDIT segment's (vmaddr - fileoff) delta differ from earlier | |
| # segments. OcAppleKernelLib's MachoInitializeContext rejects this | |
| # inconsistency and OC reports "Invalid Parameter" during prelinked | |
| # injection. Sonoma14.4 build is unaffected because the override is | |
| # only applied here. | |
| xcodebuild -project itlwm.xcodeproj -target "AirportItlwm-Sonoma14.4" -configuration Debug \ | |
| SYMROOT="$(pwd)/build/Build/Products" \ | |
| OBJROOT="$(pwd)/build/Build/Intermediates.noindex" \ | |
| GIT_COMMIT=_${SHORT_SHA} \ | |
| GCC_PREPROCESSOR_DEFINITIONS='$(inherited) __IO80211_TARGET=__MAC_15_0' \ | |
| OTHER_LDFLAGS='$(inherited) -Xlinker -no_zero_fill_sections' \ | |
| CONFIGURATION_BUILD_DIR='$(SYMROOT)/$(CONFIGURATION)/Sequoia15' \ | |
| 2>&1 | tee /tmp/seq-build.log | |
| # Print the last error block for visibility, then re-emit failure | |
| echo "===== LAST 50 LINES BEFORE FAILURE =====" | |
| grep -B 50 "BUILD FAILED" /tmp/seq-build.log | tail -100 || true | |
| echo "===== ALL ERROR LINES =====" | |
| grep -E " error:" /tmp/seq-build.log | head -30 || true | |
| ! grep -q "BUILD FAILED" /tmp/seq-build.log | |
| - name: Build AirportItlwmShim (Lilu plugin for Sequoia) | |
| run: | | |
| # Standalone build script, no Xcode target. Output goes alongside the | |
| # other kexts in $BUILD_OUTPUT so the packing stage picks it up. | |
| OUT_DIR="$(pwd)/${BUILD_OUTPUT}/Sequoia15" \ | |
| bash AirportItlwmShim/build.sh | |
| ls -la "${BUILD_OUTPUT}/Sequoia15/" || true | |
| - name: Pack Artifacts | |
| run: | | |
| cd $BUILD_OUTPUT | |
| zip -r itlwm-v${ITLWM_VER}-${SHORT_SHA}.zip itlwm.kext | |
| while read -r tgt ; do | |
| zip -r AirportItlwm-${tgt// /_}-v${ITLWM_VER}-${SHORT_SHA}.zip "$tgt" | |
| done < <(find . -mindepth 1 -maxdepth 1 -type d -not -path "*.kext" | cut -c 3-) | |
| cd - | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: kexts-${{ env.SHORT_SHA }} | |
| # Only upload Sequoia15 to stay under GitHub artifact storage quota | |
| # (500MB free tier). Sequoia15 zip is ~15MB vs ~135MB for full set. | |
| # Master branch's GitHub Release (line ~115) still publishes the | |
| # complete set for end users on older macOS versions. | |
| path: ${{ env.BUILD_OUTPUT }}/AirportItlwm-Sequoia15-*.zip | |
| retention-days: 30 | |