Add ANGLE static libraries to Avalonia apphost #41
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| env: | |
| LINUX_SYSROOT_CACHE_KEY: linux-sysroot-bionic-amd64 | |
| # Keep the job graph below in sync with the Mermaid workflow diagram in DEVELOPMENT.md. | |
| jobs: | |
| windows-hostlibs: | |
| runs-on: windows-2025-vs2026 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x64 | |
| rid: win-x64 | |
| hostlibs_flavor: default | |
| build_args: "" | |
| - arch: arm64 | |
| rid: win-arm64 | |
| hostlibs_flavor: default | |
| build_args: "" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Compute hostlibs cache key | |
| id: hostlibs_key | |
| shell: powershell | |
| run: | | |
| $key = python .\scripts\cache_key.py --kind hostlibs --arch ${{ matrix.arch }} --os windows --hostlibs-flavor ${{ matrix.hostlibs_flavor }} | |
| "key=$key" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| # `lookup-only` is intentional here: `actions/cache` still runs its post step, | |
| # so a cache miss in this job will save the built output for downstream restore jobs. | |
| - name: Lookup hostlibs cache | |
| id: cache_hostlibs | |
| uses: actions/cache@v5 | |
| with: | |
| lookup-only: true | |
| path: artifacts\hostlibs | |
| key: ${{ steps.hostlibs_key.outputs.key }} | |
| - name: Checkout runtime deps | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: python .\scripts\checkout-deps.py runtime | |
| - name: Build hostlibs for Windows | |
| shell: powershell | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| run: python .\scripts\build-hostlibs.py all -v --arch ${{ matrix.arch }} ${{ matrix.build_args }} | |
| - name: Upload hostlibs artifact | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: hostlibs-${{ matrix.hostlibs_flavor }}-${{ matrix.rid }} | |
| path: artifacts\hostlibs | |
| if-no-files-found: error | |
| windows-matrix-test: | |
| runs-on: windows-2025-vs2026 | |
| needs: | |
| - windows-hostlibs | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Compute hostlibs cache key (default win-x64) | |
| id: hostlibs_key | |
| shell: powershell | |
| run: | | |
| $key = python .\scripts\cache_key.py --kind hostlibs --arch x64 --os windows --hostlibs-flavor default | |
| "key=$key" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Restore hostlibs cache (default win-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\hostlibs | |
| key: ${{ steps.hostlibs_key.outputs.key }} | |
| - name: Run matrix integration build | |
| shell: powershell | |
| run: python .\scripts\pipeline.py matrix -v | |
| windows-skia: | |
| runs-on: windows-2025-vs2026 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x64 | |
| rid: win-x64 | |
| - arch: arm64 | |
| rid: win-arm64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Install LLVM | |
| uses: ./.github/actions/install-llvm | |
| - name: Compute skia cache key | |
| id: skia_key | |
| shell: powershell | |
| run: | | |
| $key = python .\scripts\cache_key.py --kind skiasharp --arch ${{ matrix.arch }} --os windows | |
| "key=$key" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Lookup skia cache | |
| id: cache_skia | |
| uses: actions/cache@v5 | |
| with: | |
| lookup-only: true | |
| path: artifacts\skiasharp | |
| key: ${{ steps.skia_key.outputs.key }} | |
| - name: Checkout Skia deps | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: python .\scripts\checkout-deps.py skiasharp | |
| - name: Build SkiaSharp and HarfBuzz for Windows | |
| shell: powershell | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| run: python .\scripts\build-skia-harfbuzz.py -v -a ${{ matrix.arch }} --os windows | |
| - name: Upload skiasharp artifact | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: skiasharp-${{ matrix.rid }} | |
| path: artifacts\skiasharp | |
| if-no-files-found: error | |
| windows-angle: | |
| runs-on: windows-2025-vs2026 | |
| strategy: | |
| matrix: | |
| include: | |
| - arch: x64 | |
| rid: win-x64 | |
| - arch: arm64 | |
| rid: win-arm64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Compute ANGLE cache key | |
| id: angle_key | |
| shell: powershell | |
| run: | | |
| $key = python .\scripts\cache_key.py --kind angle --arch ${{ matrix.arch }} --os windows | |
| "key=$key" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Lookup ANGLE cache | |
| id: cache_angle | |
| uses: actions/cache@v5 | |
| with: | |
| lookup-only: true | |
| path: artifacts\angle | |
| key: ${{ steps.angle_key.outputs.key }} | |
| - name: Install depot_tools | |
| if: steps.cache_angle.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: | | |
| git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git "$env:RUNNER_TEMP\depot_tools" | |
| "$env:RUNNER_TEMP\depot_tools" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| - name: Checkout ANGLE | |
| if: steps.cache_angle.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: python .\scripts\checkout-deps.py angle | |
| - name: Build ANGLE static libraries | |
| if: steps.cache_angle.outputs.cache-hit != 'true' | |
| shell: powershell | |
| run: python .\scripts\build-angle.py -v --arch ${{ matrix.arch }} | |
| - name: Upload ANGLE artifact | |
| if: steps.cache_angle.outputs.cache-hit != 'true' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: angle-${{ matrix.rid }} | |
| path: artifacts\angle | |
| if-no-files-found: error | |
| windows-link-avalonia: | |
| runs-on: windows-2025-vs2026 | |
| needs: | |
| - windows-hostlibs | |
| - windows-skia | |
| - windows-angle | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Install LLVM | |
| uses: ./.github/actions/install-llvm | |
| - name: Compute hostlibs cache keys | |
| id: hostlibs_keys | |
| shell: powershell | |
| run: | | |
| $keyX64 = python .\scripts\cache_key.py --kind hostlibs --arch x64 --os windows --hostlibs-flavor default | |
| "key_x64=$keyX64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| $keyArm64 = python .\scripts\cache_key.py --kind hostlibs --arch arm64 --os windows --hostlibs-flavor default | |
| "key_arm64=$keyArm64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Restore hostlibs cache (win-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\hostlibs | |
| key: ${{ steps.hostlibs_keys.outputs.key_x64 }} | |
| - name: Restore hostlibs cache (win-arm64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\hostlibs | |
| key: ${{ steps.hostlibs_keys.outputs.key_arm64 }} | |
| - name: Compute skia cache keys | |
| id: skia_keys | |
| shell: powershell | |
| run: | | |
| $keySkiaX64 = python .\scripts\cache_key.py --kind skiasharp --arch x64 --os windows | |
| "key_skia_x64=$keySkiaX64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| $keySkiaArm64 = python .\scripts\cache_key.py --kind skiasharp --arch arm64 --os windows | |
| "key_skia_arm64=$keySkiaArm64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Restore skia cache (win-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\skiasharp | |
| key: ${{ steps.skia_keys.outputs.key_skia_x64 }} | |
| - name: Restore skia cache (win-arm64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\skiasharp | |
| key: ${{ steps.skia_keys.outputs.key_skia_arm64 }} | |
| - name: Compute ANGLE cache keys | |
| id: angle_keys | |
| shell: powershell | |
| run: | | |
| $keyAngleX64 = python .\scripts\cache_key.py --kind angle --arch x64 --os windows | |
| "key_angle_x64=$keyAngleX64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| $keyAngleArm64 = python .\scripts\cache_key.py --kind angle --arch arm64 --os windows | |
| "key_angle_arm64=$keyAngleArm64" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| - name: Restore ANGLE cache (win-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\angle | |
| key: ${{ steps.angle_keys.outputs.key_angle_x64 }} | |
| - name: Restore ANGLE cache (win-arm64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts\angle | |
| key: ${{ steps.angle_keys.outputs.key_angle_arm64 }} | |
| - name: Link Avalonia apphost templates for Windows | |
| shell: powershell | |
| run: python .\scripts\pipeline.py link-avalonia -v --os windows | |
| - name: Upload Windows Avalonia apphost artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: avalonia-host-windows | |
| path: artifacts\avalonia-host | |
| if-no-files-found: error | |
| - name: Run Avalonia App Host package tests | |
| shell: powershell | |
| run: python .\scripts\pipeline.py avalonia-test -v | |
| linux-sysroot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Build and cache Linux sysroot | |
| uses: ./.github/actions/sysroot-cache | |
| with: | |
| cache-key: ${{ env.LINUX_SYSROOT_CACHE_KEY }} | |
| linux-hostlibs: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - linux-sysroot | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Restore Linux sysroot | |
| id: restore_sysroot | |
| uses: ./.github/actions/sysroot-restore | |
| with: | |
| cache-key: ${{ env.LINUX_SYSROOT_CACHE_KEY }} | |
| - name: Compute hostlibs cache key | |
| id: hostlibs_key | |
| run: | | |
| key=$(python ./scripts/cache_key.py --kind hostlibs --arch x64 --os linux --hostlibs-flavor default) | |
| echo "key=$key" >> "$GITHUB_OUTPUT" | |
| - name: Lookup hostlibs cache | |
| id: cache_hostlibs | |
| uses: actions/cache@v5 | |
| with: | |
| lookup-only: true | |
| path: artifacts/hostlibs | |
| key: ${{ steps.hostlibs_key.outputs.key }} | |
| - name: Checkout runtime deps | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| run: python ./scripts/checkout-deps.py runtime | |
| - name: Install runtime native dependencies | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| run: | | |
| runtime_dir=$(python ./scripts/checkout-deps.py --print-source-dir runtime) | |
| sudo "$runtime_dir/eng/common/native/install-dependencies.sh" linux | |
| - name: Build hostlibs for Linux x64 | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| env: | |
| ROOTFS_DIR: ${{ steps.restore_sysroot.outputs.sysroot-path }} | |
| run: python ./scripts/build-hostlibs.py -v --os linux --arch x64 | |
| - name: Upload hostlibs artifact | |
| if: steps.cache_hostlibs.outputs.cache-hit != 'true' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: hostlibs-default-linux-x64 | |
| path: artifacts/hostlibs | |
| if-no-files-found: error | |
| linux-matrix-test: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - linux-sysroot | |
| - linux-hostlibs | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Restore Linux sysroot | |
| uses: ./.github/actions/sysroot-restore | |
| with: | |
| cache-key: ${{ env.LINUX_SYSROOT_CACHE_KEY }} | |
| - name: Install LLVM | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y llvm | |
| - name: Compute hostlibs cache key (linux-x64) | |
| id: hostlibs_key | |
| run: | | |
| key=$(python ./scripts/cache_key.py --kind hostlibs --arch x64 --os linux --hostlibs-flavor default) | |
| echo "key=$key" >> "$GITHUB_OUTPUT" | |
| - name: Restore hostlibs cache (linux-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts/hostlibs | |
| key: ${{ steps.hostlibs_key.outputs.key }} | |
| - name: Run matrix integration build | |
| run: python ./scripts/pipeline.py matrix -v | |
| linux-skia: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - linux-sysroot | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Restore Linux sysroot | |
| id: restore_sysroot | |
| uses: ./.github/actions/sysroot-restore | |
| with: | |
| cache-key: ${{ env.LINUX_SYSROOT_CACHE_KEY }} | |
| - name: Compute skia cache key | |
| id: skia_key | |
| run: | | |
| key=$(python ./scripts/cache_key.py --kind skiasharp --arch x64 --os linux --clang clang) | |
| echo "key=$key" >> "$GITHUB_OUTPUT" | |
| - name: Lookup skia cache | |
| id: cache_skia | |
| uses: actions/cache@v5 | |
| with: | |
| lookup-only: true | |
| path: artifacts/skiasharp | |
| key: ${{ steps.skia_key.outputs.key }} | |
| - name: Checkout Skia deps | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| run: python ./scripts/checkout-deps.py skiasharp | |
| - name: Build SkiaSharp and HarfBuzz for Linux | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| env: | |
| CC: clang | |
| CXX: clang++ | |
| ROOTFS_DIR: ${{ steps.restore_sysroot.outputs.sysroot-path }} | |
| run: python ./scripts/build-skia-harfbuzz.py -v --os linux --arch x64 | |
| - name: Upload skia artifact | |
| if: steps.cache_skia.outputs.cache-hit != 'true' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: skiasharp-linux-x64 | |
| path: artifacts/skiasharp | |
| if-no-files-found: error | |
| linux-link-avalonia: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - linux-sysroot | |
| - linux-hostlibs | |
| - linux-skia | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Restore Linux sysroot | |
| id: restore_sysroot | |
| uses: ./.github/actions/sysroot-restore | |
| with: | |
| cache-key: ${{ env.LINUX_SYSROOT_CACHE_KEY }} | |
| - name: Compute hostlibs cache key | |
| id: hostlibs_key | |
| run: | | |
| key=$(python ./scripts/cache_key.py --kind hostlibs --arch x64 --os linux --hostlibs-flavor default) | |
| echo "key=$key" >> "$GITHUB_OUTPUT" | |
| - name: Restore hostlibs cache (linux-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts/hostlibs | |
| key: ${{ steps.hostlibs_key.outputs.key }} | |
| - name: Compute skia cache key | |
| id: skia_key | |
| run: | | |
| key=$(python ./scripts/cache_key.py --kind skiasharp --arch x64 --os linux --clang clang) | |
| echo "key=$key" >> "$GITHUB_OUTPUT" | |
| - name: Restore skia cache (linux-x64) | |
| uses: actions/cache@v5 | |
| with: | |
| fail-on-cache-miss: true | |
| path: artifacts/skiasharp | |
| key: ${{ steps.skia_key.outputs.key }} | |
| - name: Link Avalonia apphost templates for Linux | |
| run: python ./scripts/pipeline.py link-avalonia -v --os linux --sysroot "${{ steps.restore_sysroot.outputs.sysroot-path }}" | |
| - name: Run Avalonia App Host package tests | |
| run: python ./scripts/pipeline.py avalonia-test -v --sysroot "${{ steps.restore_sysroot.outputs.sysroot-path }}" | |
| - name: Upload Linux Avalonia apphost artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: avalonia-host-linux | |
| path: artifacts/avalonia-host | |
| if-no-files-found: error | |
| pack-avalonia: | |
| runs-on: windows-2025-vs2026 | |
| needs: | |
| - windows-link-avalonia | |
| - linux-link-avalonia | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| submodules: false | |
| - name: Download Windows Avalonia apphost artifact | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: avalonia-host-windows | |
| path: artifacts\avalonia-host | |
| - name: Download Linux Avalonia apphost artifact | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: avalonia-host-linux | |
| path: artifacts\avalonia-host | |
| - name: Pack Avalonia apphost | |
| shell: powershell | |
| run: python .\scripts\pipeline.py pack-avalonia -v --mode all | |
| - name: Upload nuget packages | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: nuget-packages-avalonia | |
| path: artifacts\packages\Release | |
| if-no-files-found: error |