|
| 1 | +name: build-apple-slices-hermes |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + release-type: |
| 7 | + required: true |
| 8 | + description: The type of release we are building. It could be commitly, release or dry-run |
| 9 | + type: string |
| 10 | + hermes-version: |
| 11 | + required: true |
| 12 | + description: The Hermes version to use for this build |
| 13 | + type: string |
| 14 | + |
| 15 | +jobs: |
| 16 | + build_apple_slices_hermes: |
| 17 | + runs-on: macos-15 |
| 18 | + env: |
| 19 | + IOS_DEPLOYMENT_TARGET: "15.1" |
| 20 | + XROS_DEPLOYMENT_TARGET: "1.0" |
| 21 | + MAC_DEPLOYMENT_TARGET: "10.15" |
| 22 | + strategy: |
| 23 | + fail-fast: false |
| 24 | + matrix: |
| 25 | + flavor: [Debug, Release] |
| 26 | + slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator] |
| 27 | + steps: |
| 28 | + - name: Checkout |
| 29 | + uses: actions/checkout@v4 |
| 30 | + - name: Setup git safe folders |
| 31 | + shell: bash |
| 32 | + run: git config --global --add safe.directory '*' |
| 33 | + - name: Setup node.js |
| 34 | + uses: ./.github/actions/setup-node |
| 35 | + - name: Install node dependencies |
| 36 | + uses: ./.github/actions/yarn-install |
| 37 | + - name: Set artifacts version |
| 38 | + shell: bash |
| 39 | + run: node ./utils/scripts/hermes/set-artifacts-version.js --build-type ${{ inputs.release-type }} --hermesVersion "${{ inputs.hermes-version }}" |
| 40 | + - name: Setup xcode |
| 41 | + uses: ./.github/actions/setup-xcode |
| 42 | + - name: Restore HermesC Artifact |
| 43 | + uses: actions/download-artifact@v4 |
| 44 | + with: |
| 45 | + name: hermesc-apple |
| 46 | + path: ./build_host_hermesc |
| 47 | + - name: Build the Hermes ${{ matrix.slice }} frameworks |
| 48 | + shell: bash |
| 49 | + run: | |
| 50 | + SLICE=${{ matrix.slice }} |
| 51 | + FLAVOR=${{ matrix.flavor }} |
| 52 | + FINAL_PATH=build_"$SLICE"_"$FLAVOR" |
| 53 | + echo "Final path for this slice is: $FINAL_PATH" |
| 54 | +
|
| 55 | + # HermesC is used to build hermes, so it has to be executable |
| 56 | + chmod +x ./build_host_hermesc/bin/hermesc |
| 57 | +
|
| 58 | + if [[ "$SLICE" == "macosx" ]]; then |
| 59 | + echo "[HERMES] Building Hermes for MacOS" |
| 60 | +
|
| 61 | + chmod +x ./utils/build-mac-framework.sh |
| 62 | + BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-mac-framework.sh |
| 63 | + else |
| 64 | + echo "[HERMES] Building Hermes for iOS: $SLICE" |
| 65 | +
|
| 66 | + chmod +x ./utils/build-ios-framework.sh |
| 67 | + BUILD_TYPE="${{ matrix.flavor }}" ./utils/build-ios-framework.sh "$SLICE" |
| 68 | + fi |
| 69 | +
|
| 70 | + echo "Moving from build_$SLICE to $FINAL_PATH" |
| 71 | + mv build_"$SLICE" "$FINAL_PATH" |
| 72 | +
|
| 73 | + # check whether everything is there |
| 74 | + if [[ -d "$FINAL_PATH/lib/hermesvm.framework" ]]; then |
| 75 | + echo "Successfully built hermesvm.framework for $SLICE in $FLAVOR" |
| 76 | + else |
| 77 | + echo "Failed to built hermesvm.framework for $SLICE in $FLAVOR" |
| 78 | + exit 1 |
| 79 | + fi |
| 80 | +
|
| 81 | + if [[ -d "$FINAL_PATH/lib/hermesvm.framework.dSYM" ]]; then |
| 82 | + echo "Successfully built hermesvm.framework.dSYM for $SLICE in $FLAVOR" |
| 83 | + else |
| 84 | + echo "Failed to built hermesvm.framework.dSYM for $SLICE in $FLAVOR" |
| 85 | + echo "Please try again" |
| 86 | + exit 1 |
| 87 | + fi |
| 88 | + - name: Compress slices to preserve Symlinks |
| 89 | + shell: bash |
| 90 | + run: | |
| 91 | + tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }} |
| 92 | + - name: Upload Artifact for Slice (${{ matrix.slice }}, ${{ matrix.flavor }}} |
| 93 | + |
| 94 | + with: |
| 95 | + name: slice-${{ matrix.slice }}-${{ matrix.flavor }} |
| 96 | + path: ./build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz |
0 commit comments