Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 66 additions & 1 deletion .github/workflows/ios-prebuild-external-xcframeworks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ on:
description: 'Max parallel packages (default: auto)'
required: false
default: ''
publish:
description: 'Publish XCFramework archive to GCS'
required: false
type: boolean
default: false
sdk-version:
description: 'SDK version used in the GCS object path'
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
Expand All @@ -20,7 +29,11 @@ jobs:
prebuild:
runs-on: macos-15
timeout-minutes: 120
permissions:
contents: read
id-token: write
strategy:
fail-fast: false
matrix:
flavor: [Debug, Release]
steps:
Expand All @@ -29,6 +42,16 @@ jobs:
with:
submodules: true

- name: Validate inputs
env:
INPUT_PACKAGES: ${{ github.event.inputs.packages }}
INPUT_PUBLISH: ${{ github.event.inputs.publish }}
run: |
if [[ "$INPUT_PUBLISH" == "true" ]] && [[ -n "$INPUT_PACKAGES" ]]; then
echo "packages input must be empty when publish=true"
exit 1
fi

- name: Switch to Xcode 26.2
run: sudo xcode-select --switch /Applications/Xcode_26.2.app

Expand All @@ -50,6 +73,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Prebuild External XCFrameworks (${{ matrix.flavor }})
id: prebuild_xcframeworks
env:
INPUT_PACKAGES: ${{ github.event.inputs.packages }}
INPUT_CONCURRENCY: ${{ github.event.inputs.concurrency }}
Expand All @@ -73,6 +97,47 @@ jobs:
with:
name: xcframeworks-${{ matrix.flavor }}
path: packages/precompile/.build/*/output/**/${{ matrix.flavor == 'Debug' && 'debug' || 'release' }}/xcframeworks/*.tar.gz
if-no-files-found: error
if-no-files-found: warn
retention-days: 14
include-hidden-files: true

- name: Package XCFrameworks (${{ matrix.flavor }})
id: package_xcframeworks
if: ${{ !cancelled() }}
run: |
FLAVOR_LOWER=$(echo "${{ matrix.flavor }}" | tr '[:upper:]' '[:lower:]')
ARCHIVE_PATH="$RUNNER_TEMP/xcframeworks-${{ matrix.flavor }}.zip"
FILE_LIST="$RUNNER_TEMP/xcframeworks-${{ matrix.flavor }}.txt"

cd packages/precompile/.build
find . -type f -name "*.tar.gz" | grep "/${FLAVOR_LOWER}/xcframeworks/" | sort > "$FILE_LIST"

if [ ! -s "$FILE_LIST" ]; then
echo "::warning::No XCFramework tarballs found for flavor ${{ matrix.flavor }}; skipping zip packaging."
echo "archive_path=" >> $GITHUB_OUTPUT
exit 0
fi

rm -f "$ARCHIVE_PATH"
zip -q "$ARCHIVE_PATH" -@ < "$FILE_LIST"
echo "archive_path=$ARCHIVE_PATH" >> $GITHUB_OUTPUT

- name: Authenticate to Google Cloud
if: ${{ success() && github.event.inputs.publish == 'true' && steps.package_xcframeworks.outputs.archive_path != '' }}
uses: google-github-actions/auth@v3
with:
project_id: exponentjs
workload_identity_provider: projects/321830142373/locations/global/workloadIdentityPools/github/providers/expo

- name: Setup gcloud
if: ${{ success() && github.event.inputs.publish == 'true' && steps.package_xcframeworks.outputs.archive_path != '' }}
uses: google-github-actions/setup-gcloud@v2
with:
project_id: exponentjs

- name: Upload XCFramework zip to GCS
if: ${{ success() && github.event.inputs.publish == 'true' && steps.package_xcframeworks.outputs.archive_path != '' }}
run: |
gcloud storage cp \
"${{ steps.package_xcframeworks.outputs.archive_path }}" \
"gs://eas-build-precompiled-modules/precompiled-modules/${{ github.event.inputs.sdk-version }}/xcframeworks-${{ matrix.flavor }}.zip"
4 changes: 2 additions & 2 deletions apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading