5353 # --- Step 3: Build the iOS Branch SDK Framework ---
5454 - name : Build Branch SDK Framework
5555 run : |
56+ echo "--- Listing contents of the SDK repo directory for debugging ---"
57+ ls -R . # List contents recursively from the current working directory
58+ echo "-------------------------------------------------------------"
59+ echo "Attempting to build the SDK framework..."
5660 xcodebuild build -project BranchSDK.xcodeproj \
5761 -scheme BranchSDK \
5862 -configuration Debug \
@@ -78,15 +82,14 @@ jobs:
7882 cp -R ./branch-ios-sdk-repo/build/Debug-iphonesimulator/BranchSDK.framework ./ios-app-repo/Frameworks/
7983 working-directory : ${{ github.workspace }} # Run from the root of the GITHUB_WORKSPACE
8084
81- # --- Step 6: Build the iOS Branch Link Simulator App using the local SDK Framework ---
85+ # --- Step 6: Build the iOS App using the local SDK Framework and get output path ---
8286 - name : Build iOS App with local SDK
8387 run : |
84- # The -project flag defines the project root from which SRCROOT is relative.
85- # The `BUILD_DIR` is where products are placed. We'll rely on xcodebuild's default DerivedData location,
86- # and then capture the specific path to the .app bundle using `xcodebuild -showBuildSettings`.
87- # This command ensures the build output variables are available.
8888 set -o pipefail # Fail if any part of the pipe fails
89- XCODEBUILD_OUTPUT=$(xcodebuild build -project BranchLinkSimulator.xcodeproj \
89+
90+ # First, perform the build. Pipe to xcpretty for cleaner logs if installed.
91+ # Note: xcpretty is optional, if you don't have it installed in your runner environment, remove '| xcpretty'
92+ xcodebuild build -project BranchLinkSimulator.xcodeproj \
9093 -scheme BranchLinkSimulator \
9194 -configuration Debug \
9295 -sdk iphonesimulator \
@@ -95,19 +98,16 @@ jobs:
9598 CURRENT_PROJECT_VERSION=${{ env.VERSION_CODE_INT }} \
9699 FRAMEWORK_SEARCH_PATHS="$(SRCROOT)/Frameworks" \
97100 ONLY_ACTIVE_ARCH=YES \
98- | xcpretty # xcpretty makes xcodebuild output readable, install it if not present
101+ | xcpretty || true # Added || true to prevent build failure due to xcpretty if it's not installed or errors.
99102
100- # Extract BUILT_PRODUCTS_DIR from xcodebuild output
101- # This command must be run AFTER the build, and often requires parsing
102- # a successful build log for the definitive path.
103- # A more robust way is to query build settings directly:
103+ # Now, query build settings to get the exact output directory
104104 BUILT_PRODUCTS_DIR=$(xcodebuild -project BranchLinkSimulator.xcodeproj \
105105 -scheme BranchLinkSimulator \
106106 -configuration Debug \
107107 -sdk iphonesimulator \
108108 -showBuildSettings \
109109 | grep -m 1 "BUILT_PRODUCTS_DIR =" \
110- | sed 's/.*BUILT_PRODUCTS_DIR = //')
110+ | sed 's/.*BUILT_PRODUCTS_DIR = //') # <-- Added missing ')' here
111111
112112 if [ -z "$BUILT_PRODUCTS_DIR" ]; then
113113 echo "Error: Could not determine BUILT_PRODUCTS_DIR."
@@ -122,7 +122,6 @@ jobs:
122122 # --- Step 7: Echo the location of the generated .app bundle ---
123123 - name : Echo .app bundle location
124124 run : |
125- # Use the dynamically determined BUILT_PRODUCTS_DIR
126125 APP_PATH="${{ env.BUILT_PRODUCTS_DIR }}/BranchLinkSimulator.app"
127126 echo "Generated .app bundle location: $APP_PATH"
128127
@@ -131,15 +130,14 @@ jobs:
131130 uses : actions/upload-artifact@v4
132131 with :
133132 name : BranchLinkSimulator-iOS-Debug-Build
134- # Use the dynamically determined BUILT_PRODUCTS_DIR
135133 path : " ${{ env.BUILT_PRODUCTS_DIR }}/BranchLinkSimulator.app"
136134
137135 # --- Step 9: Upload and run tests on GPTDriver service. ---
138136 - name : Run GPTDriver tests
139137 run : |
140138 # Ensure the script is executable
141139 chmod +x ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh
142- # Use the dynamically determined BUILT_PRODUCTS_DIR
140+ # Execute the script, passing the .app path and platform
143141 bash ./branch-ios-sdk-repo/.github/gptdriverrunscript.sh "${{ env.BUILT_PRODUCTS_DIR }}/BranchLinkSimulator.app" ios
144142 env :
145143 API_ORG_KEY : ${{ secrets.MOBILEBOOST_API_ORG_KEY }}
0 commit comments