|
| 1 | +name: 'Expo native build (@clerk/expo)' |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened, ready_for_review] |
| 6 | + branches: |
| 7 | + - main |
| 8 | + paths: |
| 9 | + - '.github/workflows/expo-native-build.yml' |
| 10 | + - 'integration/templates/expo-native/**' |
| 11 | + - 'packages/expo/**' |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +concurrency: |
| 18 | + group: expo-native-build-${{ github.head_ref || github.ref }} |
| 19 | + cancel-in-progress: true |
| 20 | + |
| 21 | +env: |
| 22 | + FIXTURE_DIR: integration/templates/expo-native |
| 23 | + FIXTURE_PUBLISHABLE_KEY: pk_test_ZHVtbXkuY2xlcmsuYWNjb3VudHMuZGV2JA |
| 24 | + SDK_PACK_DIR: /tmp/clerk-expo-pack |
| 25 | + |
| 26 | +jobs: |
| 27 | + native-build: |
| 28 | + if: ${{ github.head_ref != 'changeset-release/main' }} |
| 29 | + name: Expo ${{ matrix.expo-sdk }} / ${{ matrix.platform }} |
| 30 | + runs-on: ${{ matrix.runner }} |
| 31 | + timeout-minutes: 45 |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - expo-sdk: 54 |
| 37 | + platform: android |
| 38 | + runner: blacksmith-8vcpu-ubuntu-2204 |
| 39 | + - expo-sdk: 54 |
| 40 | + platform: ios |
| 41 | + runner: blacksmith-6vcpu-macos-26 |
| 42 | + - expo-sdk: 55 |
| 43 | + platform: android |
| 44 | + runner: blacksmith-8vcpu-ubuntu-2204 |
| 45 | + - expo-sdk: 55 |
| 46 | + platform: ios |
| 47 | + runner: blacksmith-6vcpu-macos-26 |
| 48 | + - expo-sdk: 56 |
| 49 | + platform: android |
| 50 | + runner: blacksmith-8vcpu-ubuntu-2204 |
| 51 | + - expo-sdk: 56 |
| 52 | + platform: ios |
| 53 | + runner: blacksmith-6vcpu-macos-26 |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout repo |
| 57 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 |
| 58 | + with: |
| 59 | + persist-credentials: false |
| 60 | + |
| 61 | + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 |
| 62 | + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 |
| 63 | + with: |
| 64 | + node-version: 24.15.0 |
| 65 | + cache: pnpm |
| 66 | + |
| 67 | + - name: Install monorepo dependencies |
| 68 | + run: pnpm install --frozen-lockfile |
| 69 | + |
| 70 | + - name: Build and pack @clerk/expo |
| 71 | + run: | |
| 72 | + pnpm --filter @clerk/expo... build |
| 73 | + mkdir -p "$SDK_PACK_DIR" |
| 74 | + pnpm --filter @clerk/expo pack --pack-destination "$SDK_PACK_DIR" |
| 75 | + SDK_TARBALL="$(ls "$SDK_PACK_DIR"/clerk-expo-*.tgz)" |
| 76 | + if tar -tf "$SDK_TARBALL" | grep -q '^package/e2e/'; then |
| 77 | + echo "Fixture files must not be packed into @clerk/expo" |
| 78 | + exit 1 |
| 79 | + fi |
| 80 | +
|
| 81 | + - name: Install fixture dependencies |
| 82 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 83 | + env: |
| 84 | + EXPO_SDK: ${{ matrix.expo-sdk }} |
| 85 | + run: | |
| 86 | + cp "package.sdk-$EXPO_SDK.json" package.json |
| 87 | + pnpm install --no-frozen-lockfile |
| 88 | + SDK_TARBALL="$(ls "$SDK_PACK_DIR"/clerk-expo-*.tgz)" |
| 89 | + pnpm add "$SDK_TARBALL" -w |
| 90 | + pnpm expo install expo-auth-session expo-constants expo-crypto expo-dev-client expo-secure-store expo-web-browser |
| 91 | +
|
| 92 | + - name: Write fixture .env |
| 93 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 94 | + run: | |
| 95 | + echo "EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY=$FIXTURE_PUBLISHABLE_KEY" > .env |
| 96 | +
|
| 97 | + - name: Set up JDK 17 |
| 98 | + if: ${{ matrix.platform == 'android' }} |
| 99 | + uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 |
| 100 | + with: |
| 101 | + distribution: temurin |
| 102 | + java-version: 17 |
| 103 | + |
| 104 | + - name: Prebuild Android fixture |
| 105 | + if: ${{ matrix.platform == 'android' }} |
| 106 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 107 | + run: pnpm expo prebuild --clean --platform android |
| 108 | + |
| 109 | + - name: Build Android fixture |
| 110 | + if: ${{ matrix.platform == 'android' }} |
| 111 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 112 | + run: pnpm build:android |
| 113 | + |
| 114 | + - name: Prebuild iOS fixture |
| 115 | + if: ${{ matrix.platform == 'ios' }} |
| 116 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 117 | + run: pnpm expo prebuild --clean --platform ios |
| 118 | + |
| 119 | + - name: Build iOS fixture |
| 120 | + if: ${{ matrix.platform == 'ios' }} |
| 121 | + working-directory: ${{ env.FIXTURE_DIR }} |
| 122 | + run: pnpm build:ios |
0 commit comments