|
| 1 | +name: 'RNEF Remote Build - visionOS Simulator' |
| 2 | +description: 'Github implementation of the RNEF Remote Build for visionOS Simulator' |
| 3 | + |
| 4 | +inputs: |
| 5 | + github-token: |
| 6 | + description: "GitHub Token" |
| 7 | + required: false |
| 8 | + default: ${{ github.token }} |
| 9 | + scheme: |
| 10 | + description: The workspace scheme to build |
| 11 | + required: false |
| 12 | + default: "HelloWorld" |
| 13 | + architectures: |
| 14 | + description: The architectures to build for |
| 15 | + required: false |
| 16 | + default: "arm64 x86_64" |
| 17 | + |
| 18 | +outputs: |
| 19 | + artifact-url: |
| 20 | + description: 'URL of the relevant visionOS Simulator build artifact (could be cached)' |
| 21 | + value: ${{ steps.cached-url.outcome == 'success' && steps.cached-url.outputs.artifact-url || steps.upload-artifact.outputs.artifact-url }} |
| 22 | + |
| 23 | +runs: |
| 24 | + using: "composite" |
| 25 | + steps: |
| 26 | + - name: Native Fingerprint |
| 27 | + id: fingerprint |
| 28 | + uses: ./.github/actions/rnef-native-fingerprint |
| 29 | + with: |
| 30 | + platforms: visionos |
| 31 | + |
| 32 | + - name: Set variables |
| 33 | + run: | |
| 34 | + echo "ARTIFACT_NAME=${{inputs.scheme}}-${{inputs.architectures}}-${{ steps.fingerprint.outputs.hash}}.tar.gz" >> $GITHUB_ENV |
| 35 | + shell: bash |
| 36 | + |
| 37 | + - name: Find artifact URL |
| 38 | + id: cached-url |
| 39 | + uses: ./.github/actions/find-artifact |
| 40 | + with: |
| 41 | + name: ${{ env.ARTIFACT_NAME }} |
| 42 | + |
| 43 | + - name: Post Cached Build (if found) |
| 44 | + if: steps.cached-url.outputs.artifact-url |
| 45 | + uses: ./.github/actions/rnef-post-build |
| 46 | + with: |
| 47 | + platform: visionOS Simulator |
| 48 | + artifact-url: ${{ steps.cached-url.outputs.artifact-url }} |
| 49 | + |
| 50 | + - name: Install Pods |
| 51 | + if: ${{ !steps.cached-url.outputs.artifact-url }} |
| 52 | + run: | |
| 53 | + cd visionos |
| 54 | + pod install --verbose |
| 55 | + shell: bash |
| 56 | + |
| 57 | + - name: Build visionOS |
| 58 | + if: ${{ !steps.cached-url.outputs.artifact-url }} |
| 59 | + # Taken from: https://github.com/microsoft/rnx-kit/blob/ac1cfa362ace6172a020d2b4bcdd63c398527c17/incubator/build/scripts/build-apple.sh#L49 |
| 60 | + # @TODO replace with RNEF CLI call. |
| 61 | + run: | |
| 62 | + cd visionos |
| 63 | + xcworkspace=$(find . -maxdepth 1 -name '*.xcworkspace' -type d | head -1) |
| 64 | + xcodebuild \ |
| 65 | + -workspace "${xcworkspace}" \ |
| 66 | + -scheme "${{inputs.scheme}}" \ |
| 67 | + -destination "generic/platform=visionOS Simulator" \ |
| 68 | + -configuration Debug \ |
| 69 | + -derivedDataPath DerivedData \ |
| 70 | + ARCHS="${{inputs.architectures}}" \ |
| 71 | + CODE_SIGNING_ALLOWED=NO \ |
| 72 | + CLANG_ADDRESS_SANITIZER=NO \ |
| 73 | + CLANG_UNDEFINED_BEHAVIOR_SANITIZER=NO \ |
| 74 | + OTHER_CFLAGS='$(inherited) -fno-sanitize=undefined -fno-sanitize=bounds -fstack-protector-strong' \ |
| 75 | + OTHER_LDFLAGS='$(inherited) -fno-sanitize=undefined -fno-sanitize=bounds -fstack-protector-strong' \ |
| 76 | + COMPILER_INDEX_STORE_ENABLE=NO \ |
| 77 | + build |
| 78 | + shell: bash |
| 79 | + |
| 80 | + - name: Prepare Artifact |
| 81 | + if: ${{ !steps.cached-url.outputs.artifact-url }} |
| 82 | + run: | |
| 83 | + app=$(find visionos/DerivedData/Build/Products/Debug-iphonesimulator -maxdepth 1 -name '*.app' -type d | head -1) |
| 84 | + app_dir=$(dirname "${app}") |
| 85 | + app_name=$(basename "${app}") |
| 86 | + tar -C "${app_dir}" -czvf "${{ env.ARTIFACT_NAME }}" "${app_name}" |
| 87 | + shell: bash |
| 88 | + |
| 89 | + - name: Upload IPA |
| 90 | + id: upload-artifact |
| 91 | + if: ${{ !steps.cached-url.outputs.artifact-url }} |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + with: |
| 94 | + name: ${{ env.ARTIFACT_NAME }} |
| 95 | + path: ${{ env.ARTIFACT_NAME }} |
| 96 | + if-no-files-found: error |
| 97 | + |
| 98 | + - name: Post Build |
| 99 | + if: ${{ !steps.cached-url.outputs.artifact-url }} |
| 100 | + uses: ./.github/actions/rnef-post-build |
| 101 | + with: |
| 102 | + platform: visionOS Simulator |
| 103 | + artifact-url: ${{ steps.upload-artifact.outputs.artifact-url }} |
0 commit comments