44 push :
55 branches :
66 - main
7- - v5
87 pull_request :
98 types : [opened, synchronize, reopened, labeled]
109
8786 - uses : ruby/setup-ruby@v1
8887 if : ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
8988 with :
90- working-directory : ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || ' samples/react-native-macos' }}
89+ working-directory : ${{ matrix.platform == 'ios' && env.REACT_NATIVE_SAMPLE_PATH || 'samples/react-native-macos' }}
9190 ruby-version : ' 3.3.0' # based on what is used in the sample
9291 bundler-cache : true # runs 'bundle install' and caches installed gems automatically
9392 cache-version : 1 # cache the installed gems
@@ -114,63 +113,39 @@ jobs:
114113 if : ${{ matrix.platform == 'ios' || matrix.platform == 'macos' }}
115114 working-directory : samples
116115 run : |
117- [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native/ios
118- [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos/macos
116+ [[ "${{ matrix.platform }}" == "ios" ]] && cd react-native
117+ [[ "${{ matrix.platform }}" == "macos" ]] && cd react-native-macos
119118
120- [[ "${{ matrix.build-type }}" == "production" ]] && ENABLE_PROD=1 || ENABLE_PROD=0
121- [[ "${{ matrix.rn-architecture }}" == "new" ]] && ENABLE_NEW_ARCH=1 || ENABLE_NEW_ARCH=0
119+ [[ "${{ matrix.build-type }}" == "production" ]] && export ENABLE_PROD=1 || export ENABLE_PROD=0
120+ [[ "${{ matrix.rn-architecture }}" == "new" ]] && export ENABLE_NEW_ARCH=1 || export ENABLE_NEW_ARCH=0
122121 [[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic
123- echo "ENABLE_PROD=$ENABLE_PROD"
124- echo "ENABLE_NEW_ARCH=$ENABLE_NEW_ARCH"
125- PRODUCTION=$ENABLE_PROD RCT_NEW_ARCH_ENABLED=$ENABLE_NEW_ARCH bundle exec pod install
126- cat Podfile.lock | grep $RN_SENTRY_POD_NAME
122+
123+ ./scripts/pod-install.sh
127124
128125 - name : Build Android App
129126 if : ${{ matrix.platform == 'android' }}
130- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android
127+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
131128 run : |
132- if [[ ${{ matrix.rn-architecture }} == 'new' ]]; then
133- perl -i -pe's/newArchEnabled=false/newArchEnabled=true/g' gradle.properties
134- echo 'New Architecture enabled'
135- elif [[ ${{ matrix.rn-architecture }} == 'legacy' ]]; then
136- perl -i -pe's/newArchEnabled=true/newArchEnabled=false/g' gradle.properties
137- echo 'Legacy Architecture enabled'
138- else
139- echo 'No changes for architecture: ${{ matrix.rn-architecture }}'
140- fi
141- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
142- echo "Building $CONFIG"
143- [[ "${{ matrix.build-type }}" == "production" ]] && TEST_TYPE='release' || TEST_TYPE='debug'
144- echo "Building $TEST_TYPE"
129+ export RN_ARCHITECTURE="${{ matrix.rn-architecture }}"
130+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='release' || export CONFIG='debug'
145131
146- ./gradlew ":app:assemble$CONFIG" -PreactNativeArchitectures=x86
132+ ./scripts/set-dsn-aos.mjs
133+ ./scripts/build-android.sh -PreactNativeArchitectures=x86
147134
148135 - name : Build iOS App
149136 if : ${{ matrix.platform == 'ios' }}
150- working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios
137+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
151138 run : |
152- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
153- echo "Building $CONFIG"
154- mkdir -p "DerivedData"
155- derivedData="$(cd "DerivedData" ; pwd -P)"
156- set -o pipefail && xcodebuild \
157- -workspace sentryreactnativesample.xcworkspace \
158- -configuration "$CONFIG" \
159- -scheme sentryreactnativesample \
160- -sdk 'iphonesimulator' \
161- -destination 'generic/platform=iOS Simulator' \
162- ONLY_ACTIVE_ARCH=yes \
163- ARCHS=arm64 \
164- -derivedDataPath "$derivedData" \
165- build \
166- | tee xcodebuild.log \
167- | xcbeautify --quieter --is-ci --disable-colored-output
139+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
140+
141+ ./scripts/set-dsn-ios.mjs
142+ ./scripts/build-ios.sh
168143
169144 - name : Build macOS App
170145 if : ${{ matrix.platform == 'macos' }}
171146 working-directory : samples/react-native-macos/macos
172147 run : |
173- [[ "${{ matrix.build-type }}" == "production" ]] && CONFIG='Release' || CONFIG='Debug'
148+ [[ "${{ matrix.build-type }}" == "production" ]] && export CONFIG='Release' || export CONFIG='Debug'
174149 echo "Building $CONFIG"
175150 mkdir -p "DerivedData"
176151 derivedData="$(cd "DerivedData" ; pwd -P)"
@@ -187,19 +162,19 @@ jobs:
187162
188163 - name : Archive iOS App
189164 if : ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
165+ working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
190166 run : |
191- cd ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/DerivedData/Build/Products/Release-iphonesimulator
192167 zip -r \
193168 ${{ github.workspace }}/${{ env.IOS_APP_ARCHIVE_PATH }} \
194169 sentryreactnativesample.app
195170
196171 - name : Archive Android App
197172 if : ${{ matrix.platform == 'android' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' }}
198173 run : |
199- mv ${{ env.REACT_NATIVE_SAMPLE_PATH }}/android/app/build/outputs/apk/release/app-release.apk app.apk
200174 zip -j \
201175 ${{ env.ANDROID_APP_ARCHIVE_PATH }} \
202- app.apk
176+ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app.apk \
177+ ${{ env.REACT_NATIVE_SAMPLE_PATH }}/app-androidTest.apk
203178
204179 - name : Upload iOS APP
205180 if : ${{ matrix.platform == 'ios' && matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }}
@@ -279,7 +254,9 @@ jobs:
279254 - name : Unzip Android APK
280255 if : ${{ matrix.platform == 'android' }}
281256 working-directory : ${{ env.REACT_NATIVE_SAMPLE_PATH }}
282- run : unzip ${{ env.ANDROID_APP_ARCHIVE_PATH }}
257+ run : |
258+ unzip ${{ env.ANDROID_APP_ARCHIVE_PATH }}
259+ rm app-androidTest.apk
283260
284261 - name : Enable Corepack
285262 run : corepack enable
0 commit comments