From c68034fffc890cf9b35157d8010da240bae573a9 Mon Sep 17 00:00:00 2001 From: Tong Chen Date: Wed, 1 Jul 2026 21:49:02 +0800 Subject: [PATCH] Use self hosted macos build view (#1723) --- .github/workflows/build-view.yml | 37 ++++++++++++++++++++++------ .github/workflows/build.yml | 33 +++++++++++++++++++++---- .github/workflows/pre-build-view.yml | 37 ++++++++++++++++++++++------ .github/workflows/pre-build.yml | 33 +++++++++++++++++++++---- 4 files changed, 116 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build-view.yml b/.github/workflows/build-view.yml index 0e198430..9972e1ac 100644 --- a/.github/workflows/build-view.yml +++ b/.github/workflows/build-view.yml @@ -15,16 +15,24 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest + - os: [self-hosted, macOS, ARM64] + self_hosted: true + runner_labels: self-hosted, macOS, ARM64 arch: arm64 artifact_name: macos-arm64 - - os: macos-15-intel + - os: [self-hosted, macOS, X64] + self_hosted: true + runner_labels: self-hosted, macOS, X64 arch: x64 artifact_name: macos-intel - os: windows-latest + self_hosted: false + runner_labels: windows-latest arch: x64 artifact_name: windows-latest - os: ubuntu-latest + self_hosted: false + runner_labels: ubuntu-latest arch: x64 artifact_name: ubuntu-latest @@ -34,9 +42,24 @@ jobs: with: clean: true + - name: Print self-hosted runner diagnostics + if: matrix.self_hosted + run: | + echo "Runner name: ${{ runner.name }}" + echo "Runner OS: ${{ runner.os }}" + echo "Runner arch: ${{ runner.arch }}" + echo "Workflow runner selector: ${{ matrix.runner_labels }}" + echo "Build arch: ${{ matrix.arch }}" + sw_vers || true + uname -a || true + node --version || true + npm --version || true + python3 --version || true + xcodebuild -version || true + # Clean node_modules on self-hosted runner to ensure fresh install - name: Clean node_modules (self-hosted) - if: contains(matrix.os, 'self-hosted') + if: matrix.self_hosted run: | rm -rf node_modules rm -rf release @@ -45,26 +68,26 @@ jobs: # Clean build outputs on GitHub-hosted runners to avoid stale artifacts in current job - name: Clean build outputs (non-Windows) - if: "!contains(matrix.os, 'self-hosted') && runner.os != 'Windows'" + if: ${{ !matrix.self_hosted && runner.os != 'Windows' }} run: | rm -rf release dist out .vite rm -rf node_modules/.cache || true - name: Clean build outputs (Windows) - if: "!contains(matrix.os, 'self-hosted') && runner.os == 'Windows'" + if: ${{ !matrix.self_hosted && runner.os == 'Windows' }} shell: pwsh run: | Remove-Item -Recurse -Force release, dist, out, .vite -ErrorAction SilentlyContinue Remove-Item -Recurse -Force node_modules/.cache -ErrorAction SilentlyContinue - name: Setup Node.js - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-node@v6 with: node-version: 20 - name: Setup Python - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41fad5dc..5d452af5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,16 +26,24 @@ jobs: strategy: matrix: include: - - os: macos-latest + - os: [self-hosted, macOS, ARM64] + self_hosted: true + runner_labels: self-hosted, macOS, ARM64 arch: arm64 artifact_name: macos-arm64 - - os: macos-15-intel + - os: [self-hosted, macOS, X64] + self_hosted: true + runner_labels: self-hosted, macOS, X64 arch: x64 artifact_name: macos-intel - os: windows-latest + self_hosted: false + runner_labels: windows-latest arch: x64 artifact_name: windows-latest - os: ubuntu-latest + self_hosted: false + runner_labels: ubuntu-latest arch: x64 artifact_name: ubuntu-latest @@ -45,21 +53,36 @@ jobs: with: clean: true + - name: Print self-hosted runner diagnostics + if: matrix.self_hosted + run: | + echo "Runner name: ${{ runner.name }}" + echo "Runner OS: ${{ runner.os }}" + echo "Runner arch: ${{ runner.arch }}" + echo "Workflow runner selector: ${{ matrix.runner_labels }}" + echo "Build arch: ${{ matrix.arch }}" + sw_vers || true + uname -a || true + node --version || true + npm --version || true + python3 --version || true + xcodebuild -version || true + # Clean node_modules on self-hosted runner to ensure fresh install - name: Clean node_modules (self-hosted) - if: contains(matrix.os, 'self-hosted') + if: matrix.self_hosted run: | rm -rf node_modules rm -rf release - name: Setup Node.js - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-node@v6 with: node-version: 20 - name: Setup Python - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/pre-build-view.yml b/.github/workflows/pre-build-view.yml index 5b45c9ae..82ae6852 100644 --- a/.github/workflows/pre-build-view.yml +++ b/.github/workflows/pre-build-view.yml @@ -15,16 +15,24 @@ jobs: fail-fast: false matrix: include: - - os: macos-latest + - os: [self-hosted, macOS, ARM64] + self_hosted: true + runner_labels: self-hosted, macOS, ARM64 arch: arm64 artifact_name: macos-arm64 - - os: macos-15-intel + - os: [self-hosted, macOS, X64] + self_hosted: true + runner_labels: self-hosted, macOS, X64 arch: x64 artifact_name: macos-intel - os: windows-latest + self_hosted: false + runner_labels: windows-latest arch: x64 artifact_name: windows-latest - os: ubuntu-latest + self_hosted: false + runner_labels: ubuntu-latest arch: x64 artifact_name: ubuntu-latest @@ -34,9 +42,24 @@ jobs: with: clean: true + - name: Print self-hosted runner diagnostics + if: matrix.self_hosted + run: | + echo "Runner name: ${{ runner.name }}" + echo "Runner OS: ${{ runner.os }}" + echo "Runner arch: ${{ runner.arch }}" + echo "Workflow runner selector: ${{ matrix.runner_labels }}" + echo "Build arch: ${{ matrix.arch }}" + sw_vers || true + uname -a || true + node --version || true + npm --version || true + python3 --version || true + xcodebuild -version || true + # Clean node_modules on self-hosted runner to ensure fresh install - name: Clean node_modules (self-hosted) - if: contains(matrix.os, 'self-hosted') + if: matrix.self_hosted run: | rm -rf node_modules rm -rf release @@ -45,26 +68,26 @@ jobs: # Clean build outputs on GitHub-hosted runners to avoid stale artifacts in current job - name: Clean build outputs (non-Windows) - if: "!contains(matrix.os, 'self-hosted') && runner.os != 'Windows'" + if: ${{ !matrix.self_hosted && runner.os != 'Windows' }} run: | rm -rf release dist out .vite rm -rf node_modules/.cache || true - name: Clean build outputs (Windows) - if: "!contains(matrix.os, 'self-hosted') && runner.os == 'Windows'" + if: ${{ !matrix.self_hosted && runner.os == 'Windows' }} shell: pwsh run: | Remove-Item -Recurse -Force release, dist, out, .vite -ErrorAction SilentlyContinue Remove-Item -Recurse -Force node_modules/.cache -ErrorAction SilentlyContinue - name: Setup Node.js - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-node@v6 with: node-version: 20 - name: Setup Python - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-python@v6 with: python-version: '3.11' diff --git a/.github/workflows/pre-build.yml b/.github/workflows/pre-build.yml index da2d2671..a3f34d0b 100644 --- a/.github/workflows/pre-build.yml +++ b/.github/workflows/pre-build.yml @@ -26,16 +26,24 @@ jobs: strategy: matrix: include: - - os: macos-latest + - os: [self-hosted, macOS, ARM64] + self_hosted: true + runner_labels: self-hosted, macOS, ARM64 arch: arm64 artifact_name: macos-arm64 - - os: macos-15-intel + - os: [self-hosted, macOS, X64] + self_hosted: true + runner_labels: self-hosted, macOS, X64 arch: x64 artifact_name: macos-intel - os: windows-latest + self_hosted: false + runner_labels: windows-latest arch: x64 artifact_name: windows-latest - os: ubuntu-latest + self_hosted: false + runner_labels: ubuntu-latest arch: x64 artifact_name: ubuntu-latest @@ -45,21 +53,36 @@ jobs: with: clean: true + - name: Print self-hosted runner diagnostics + if: matrix.self_hosted + run: | + echo "Runner name: ${{ runner.name }}" + echo "Runner OS: ${{ runner.os }}" + echo "Runner arch: ${{ runner.arch }}" + echo "Workflow runner selector: ${{ matrix.runner_labels }}" + echo "Build arch: ${{ matrix.arch }}" + sw_vers || true + uname -a || true + node --version || true + npm --version || true + python3 --version || true + xcodebuild -version || true + # Clean node_modules on self-hosted runner to ensure fresh install - name: Clean node_modules (self-hosted) - if: contains(matrix.os, 'self-hosted') + if: matrix.self_hosted run: | rm -rf node_modules rm -rf release - name: Setup Node.js - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-node@v6 with: node-version: 20 - name: Setup Python - if: "!contains(matrix.os, 'self-hosted')" + if: ${{ !matrix.self_hosted }} uses: actions/setup-python@v6 with: python-version: '3.11'