Build SKIA Graphite #11
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: Build SKIA Graphite | |
| on: workflow_dispatch | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Android builds | |
| - platform: android | |
| arch: arm | |
| runner: macos-latest-xlarge | |
| ndk_required: true | |
| - platform: android | |
| arch: arm64 | |
| runner: macos-latest-xlarge | |
| ndk_required: true | |
| - platform: android | |
| arch: x86 | |
| runner: macos-latest-xlarge | |
| ndk_required: true | |
| - platform: android | |
| arch: x64 | |
| runner: macos-latest-xlarge | |
| ndk_required: true | |
| # Apple builds (excluding tvOS for Graphite) | |
| - platform: apple | |
| arch: arm64-iphoneos | |
| runner: macos-latest-xlarge | |
| ndk_required: false | |
| - platform: apple | |
| arch: arm64-iphonesimulator | |
| runner: macos-latest-xlarge | |
| ndk_required: false | |
| - platform: apple | |
| arch: x64-iphonesimulator | |
| runner: macos-latest-xlarge | |
| ndk_required: false | |
| - platform: apple | |
| arch: arm64-macosx | |
| runner: macos-latest-xlarge | |
| ndk_required: false | |
| - platform: apple | |
| arch: x64-macosx | |
| runner: macos-latest-xlarge | |
| ndk_required: false | |
| name: Build-Graphite-${{ matrix.platform }}-${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Android NDK | |
| if: matrix.ndk_required | |
| id: setup-ndk | |
| uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # v1.5.0 | |
| with: | |
| ndk-version: r26d | |
| - name: Setup Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| download_skia: 'false' | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Apply Dawn patch | |
| run: | | |
| DAWN_GNI_FILE="./externals/skia/build_overrides/dawn.gni" | |
| if [ -f "$DAWN_GNI_FILE" ]; then | |
| echo "Applying patch to dawn.gni..." | |
| # Remove the specified lines from the end of the file | |
| sed -i.bak '/# PartitionAlloc is an optional dependency:/,$d' "$DAWN_GNI_FILE" | |
| echo "Patch applied successfully." | |
| echo "Modified dawn.gni content:" | |
| cat "$DAWN_GNI_FILE" | |
| else | |
| echo "Warning: dawn.gni file not found at $DAWN_GNI_FILE" | |
| fi | |
| - name: Build Skia with Graphite ${{ matrix.platform }} ${{ matrix.arch }} | |
| working-directory: ./packages/skia | |
| env: | |
| ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }} | |
| GIT_SYNC_DEPS_SKIP_EMSDK: 'true' | |
| ZERO_AR_DATE: 1 | |
| SK_GRAPHITE: 1 | |
| run: yarn build-skia --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} | |
| - name: Upload build artifacts | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: skia-graphite-${{ matrix.platform }}-${{ matrix.arch }} | |
| path: | | |
| ./externals/skia/out/${{ matrix.platform }}/${{ matrix.arch }}/lib*.a | |
| ./packages/skia/libs/${{ matrix.platform }}/**/* | |
| ./packages/skia/cpp/**/* | |
| # Job to create XCFrameworks after all Apple builds are complete | |
| package-apple: | |
| name: Package Apple XCFrameworks (Graphite) | |
| runs-on: macos-latest-xlarge | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Ninja | |
| uses: seanmiddleditch/gha-setup-ninja@master | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| with: | |
| download_skia: 'false' | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Download all Apple build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: skia-graphite-apple-* | |
| path: artifacts | |
| - name: Reconstruct build output structure | |
| run: | | |
| mkdir -p externals/skia/out/apple | |
| # Move downloaded artifacts to expected locations | |
| for artifact_dir in artifacts/skia-graphite-apple-*; do | |
| if [ -d "$artifact_dir" ]; then | |
| arch=$(basename "$artifact_dir" | sed 's/skia-graphite-apple-//') | |
| echo "Processing $arch from $artifact_dir" | |
| mkdir -p "externals/skia/out/apple/$arch" | |
| if [ -d "$artifact_dir/externals/skia/out/apple/$arch" ]; then | |
| cp -r "$artifact_dir/externals/skia/out/apple/$arch/"* "externals/skia/out/apple/$arch/" | |
| fi | |
| fi | |
| done | |
| - name: Build XCFrameworks (Graphite) | |
| working-directory: ./packages/skia | |
| env: | |
| GIT_SYNC_DEPS_SKIP_EMSDK: 'true' | |
| ZERO_AR_DATE: 1 | |
| SK_GRAPHITE: 1 | |
| run: | | |
| # We need to build XCFrameworks from the individual platform builds | |
| # This requires running the XCFramework creation logic from build-skia.ts | |
| npx tsx -e " | |
| import { buildXCFrameworks } from './scripts/build-skia.ts'; | |
| buildXCFrameworks(); | |
| " | |
| - name: Upload Apple XCFrameworks (Graphite) | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: skia-graphite-apple-xcframeworks | |
| path: | | |
| ./packages/skia/libs/apple/*.xcframework | |
| - name: Upload Graphite Headers | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: skia-graphite-headers | |
| path: | | |
| ./packages/skia/cpp/dawn/include/ | |
| ./packages/skia/cpp/skia/src/gpu/graphite/ |