75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
name: static-graphics-macos
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
skiasharp_version:
|
|
required: true
|
|
type: string
|
|
angle_branch:
|
|
required: true
|
|
type: string
|
|
workflow_dispatch:
|
|
inputs:
|
|
skiasharp_version:
|
|
required: true
|
|
default: "4.150.1"
|
|
type: string
|
|
angle_branch:
|
|
required: true
|
|
default: "7922"
|
|
type: string
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- rid: osx-x64
|
|
target_cpu: x64
|
|
- rid: osx-arm64
|
|
target_cpu: arm64
|
|
runs-on: macos-15
|
|
env:
|
|
SKIASHARP_VERSION: ${{ inputs.skiasharp_version }}
|
|
ANGLE_BRANCH: ${{ inputs.angle_branch }}
|
|
RID: ${{ matrix.rid }}
|
|
TARGET_CPU: ${{ matrix.target_cpu }}
|
|
WORK_DIR: ${{ github.workspace }}/External/NativeStatic/.work
|
|
OUTPUT_DIR: ${{ github.workspace }}/External/NativeStatic/${{ matrix.rid }}/native
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Restore native build cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: External/NativeStatic/.work
|
|
key: native-work-macos-${{ matrix.rid }}-${{ inputs.skiasharp_version }}-${{ inputs.angle_branch }}-${{ hashFiles('External/NativeStatic/patches/*.patch', 'scripts/build-macos-static-graphics.sh') }}
|
|
|
|
- name: Install native build dependencies
|
|
run: brew install ninja
|
|
|
|
- name: Install Xcode Metal toolchain
|
|
run: |
|
|
set -euo pipefail
|
|
cat > /tmp/staticlink-metal-check.metal <<'EOF'
|
|
#include <metal_stdlib>
|
|
using namespace metal;
|
|
kernel void staticlink_metal_check(device float* values [[buffer(0)]], uint id [[thread_position_in_grid]]) { values[id] = 0; }
|
|
EOF
|
|
if ! xcrun metal -c /tmp/staticlink-metal-check.metal -o /tmp/staticlink-metal-check.air >/dev/null 2>&1; then
|
|
sudo xcodebuild -downloadComponent MetalToolchain
|
|
fi
|
|
xcrun metal -c /tmp/staticlink-metal-check.metal -o /tmp/staticlink-metal-check.air >/dev/null
|
|
|
|
- name: Build macOS static graphics libraries
|
|
run: bash ./scripts/build-macos-static-graphics.sh all
|
|
|
|
- name: Upload macOS static archives
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: native-static-${{ matrix.rid }}
|
|
path: External/NativeStatic/${{ matrix.rid }}/*
|
|
if-no-files-found: error
|