From eed26b1601997bfff151ee6d3bb342349ed50253 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 4 Apr 2025 03:38:05 -0700 Subject: [PATCH] ci: pick blaze/macos-14 and namespace runner randomly (#11465) --- .github/workflows/release-mobile.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-mobile.yml b/.github/workflows/release-mobile.yml index 2b30834d84..0d770749e4 100644 --- a/.github/workflows/release-mobile.yml +++ b/.github/workflows/release-mobile.yml @@ -117,10 +117,31 @@ jobs: name: android path: packages/frontend/apps/android/dist - ios: - runs-on: ${{ github.ref_name == 'canary' && 'blaze/macos-14' || 'namespace-profile-macos' }} + determine-ios-runner: + runs-on: ubuntu-latest needs: - build-ios-web + outputs: + RUNNER: ${{ steps.runner.outputs.RUNNER }} + steps: + - name: Determine Runner + id: runner + # Randomly pick runner with 80% chance for blaze/macos-14 and 20% chance for namespace-profile-macos + # blaze/macos-14 is free but has limited concurrency + run: | + RANDOM_NUMBER=$(( $RANDOM % 100 + 1 )) + if [ $RANDOM_NUMBER -le 20 ]; then + echo "Selected namespace-profile-macos (20% probability)" + echo "RUNNER=namespace-profile-macos" >> $GITHUB_OUTPUT + else + echo "Selected blaze/macos-14 (80% probability)" + echo "RUNNER=blaze/macos-14" >> $GITHUB_OUTPUT + fi + + ios: + runs-on: ${{ github.ref_name == 'canary' && 'macos-latest' || needs.determine-ios-runner.outputs.RUNNER }} + needs: + - determine-ios-runner steps: - uses: actions/checkout@v4 - name: Download mobile artifact