Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): Add RN Sample Apple Testflight upload #3764

Merged
merged 33 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ba0e1eb
Add Sentry Development Team to the react native sample
krystofwoldrich Apr 17, 2024
563bf5b
Rename RN Sample application to sentry-react-native-sample
krystofwoldrich Apr 17, 2024
49bcd87
misc(samples): Add versioning to the samples
krystofwoldrich Apr 17, 2024
53a6f2f
feat(ci): Add RN Sample Apple Testflight upload
krystofwoldrich Apr 17, 2024
3a7f2f8
fix missing ruby version
krystofwoldrich Apr 17, 2024
804f07d
fix missing build number
krystofwoldrich Apr 17, 2024
e00a3e9
Add missing fastlane working dir and extra sentry envs
krystofwoldrich Apr 17, 2024
96c1b44
use default installed fastlane version
krystofwoldrich Apr 17, 2024
9998ddb
add ios to fastlane commands
krystofwoldrich Apr 17, 2024
65ff163
use fastlane from bundle
krystofwoldrich Apr 17, 2024
7e4847a
fix sample app build
krystofwoldrich Apr 18, 2024
baa678d
Merge branch 'kw-update-rn-sample-name' into kw-add-samples-versioning
krystofwoldrich Apr 18, 2024
29bb7d0
Merge branch 'kw-add-samples-versioning' into kw-add-testflight-ci
krystofwoldrich Apr 18, 2024
46fb23b
fix xc workspace path
krystofwoldrich Apr 18, 2024
ab47b37
manually select xcode version
krystofwoldrich Apr 18, 2024
7c134b4
add xcarchive to gitignore
krystofwoldrich Apr 18, 2024
59d3840
add provisioning profile to the sample xcode project
krystofwoldrich Apr 18, 2024
26cddda
misc
krystofwoldrich Apr 18, 2024
85060f4
update fast lane gitignore
krystofwoldrich Apr 18, 2024
c6e384f
Add icon for bare RN sample
krystofwoldrich Apr 18, 2024
0643453
Merge branch 'kw-add-sample-app-icon' into kw-add-testflight-ci
krystofwoldrich Apr 18, 2024
1966df5
add empty privacy manifest to the sample
krystofwoldrich Apr 18, 2024
cfd6547
use dynamic frameworks for the testflight application
krystofwoldrich Apr 18, 2024
711e24a
revert dynamic frameworks for testflight
krystofwoldrich Apr 18, 2024
9b52123
add privacy manifest to the RNSentry
krystofwoldrich Apr 18, 2024
63e6e23
Revert "add privacy manifest to the RNSentry"
krystofwoldrich Apr 18, 2024
34edca4
revert sample dynamic linking fix
krystofwoldrich Apr 18, 2024
292ccb7
revert add empty privacy manifest to sample app
krystofwoldrich Apr 18, 2024
472c50e
revert add empty privacy manifest to sample app
krystofwoldrich Apr 18, 2024
2ceac32
Merge remote-tracking branch 'origin/kw-add-testflight-ci' into kw-ad…
krystofwoldrich Apr 18, 2024
d4f87ad
Add xcode archive upload
krystofwoldrich Apr 18, 2024
be9817e
Merge remote-tracking branch 'origin/main' into kw-add-testflight-ci
krystofwoldrich Apr 19, 2024
ec8010f
Merge branch 'main' into kw-add-testflight-ci
krystofwoldrich Apr 22, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/sample-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ jobs:
mkdir -p "DerivedData"
derivedData="$(cd "DerivedData" ; pwd -P)"
set -o pipefail && xcodebuild \
-workspace sampleNewArchitecture.xcworkspace \
-workspace sentryreactnativesample.xcworkspace \
-configuration "$CONFIG" \
-scheme sampleNewArchitecture \
-scheme sentryreactnativesample \
-destination 'platform=iOS Simulator,OS=${{ matrix.runtime }},name=${{ matrix.device }}' \
ONLY_ACTIVE_ARCH=yes \
-derivedDataPath "$derivedData" \
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/testflight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Upload to Testflight
on:
push:
branches:
- main

pull_request:
paths:
- '.github/workflows/testflight.yml'

jobs:
diff_check:
uses: ./.github/workflows/skip-ci.yml

upload_to_testflight:
name: Build and Upload React Native Sample to Testflight
runs-on: macos-14
needs: [diff_check]
if: ${{ needs.diff_check.outputs.skip_ci != 'true' }}
steps:
- uses: actions/checkout@v4
- run: sudo xcode-select -s /Applications/Xcode_15.3.app/Contents/Developer
- uses: ruby/setup-ruby@v1
with:
working-directory: samples/react-native
ruby-version: '3.3.0' # based on what is used in the sample
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # cache the installed gems
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/cache@v4
id: deps-cache
with:
path: |
node_modules
samples/react-native/node_modules
key: ${{ github.workflow }}-${{ github.job }}-${{ hashFiles('yarn.lock', 'samples/react-native/yarn.lock') }}
- name: Install Dependencies
if: steps.deps-cache.outputs['cache-hit'] != 'true'
run: |
yarn install
cd samples/react-native && yarn install
- name: Build SDK
run: yarn build

# We upload a new version to TestFlight on every commit on main
# So we need to bump the build number each time
- name: Set Build Number
working-directory: samples/react-native
run: yarn set-build-number ${{ github.run_number }}

- name: Pod Install
working-directory: samples/react-native/ios
run: NO_FLIPPER=1 PRODUCTION=1 bundle exec pod install

- name: Run Fastlane
working-directory: samples/react-native
env:
APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_LOG_LEVEL: DEBUG
SENTRY_CLI_EXTRA_ARGS: "--force-foreground"
run: |
bundle exec fastlane ios build_react_native_sample
bundle exec fastlane ios upload_react_native_sample_to_testflight

- name: Upload Xcode Archive
uses: actions/upload-artifact@v4
with:
name: sentry-react-native-sample-xcode-archive-for-testflight
path: samples/react-native/sentryreactnativesample.xcarchive
retention-days: 1
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"test:watch": "jest --watch",
"run-ios": "cd samples/react-native && yarn react-native run-ios",
"run-android": "cd samples/react-native && yarn react-native run-android",
"yalc:add:sentry-javascript": "yalc add @sentry/browser @sentry/core @sentry/hub @sentry/integrations @sentry/react @sentry/types @sentry/utils"
"yalc:add:sentry-javascript": "yalc add @sentry/browser @sentry/core @sentry/hub @sentry/integrations @sentry/react @sentry/types @sentry/utils",
"set-version-samples": "bash scripts/set-version-samples.sh"
},
"bin": {
"sentry-expo-upload-sourcemaps": "scripts/expo-upload-sourcemaps.js"
Expand Down Expand Up @@ -106,6 +107,7 @@
"prettier": "^2.0.5",
"react": "18.2.0",
"react-native": "0.73.2",
"react-native-version": "^4.0.0",
"react-test-renderer": "^18.2.0",
"replace-in-file": "^7.0.1",
"rimraf": "^4.1.1",
Expand Down
10 changes: 6 additions & 4 deletions samples/expo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"slug": "sentry-react-native-expo-sample",
"jsEngine": "hermes",
"scheme": "sentry-expo-sample",
"version": "1.0.0",
"version": "5.22.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
Expand All @@ -18,14 +18,16 @@
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "io.sentry.expo.sample"
"bundleIdentifier": "io.sentry.expo.sample",
"buildNumber": "4"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "io.sentry.expo.sample"
"package": "io.sentry.expo.sample",
"versionCode": 4
},
"web": {
"bundler": "metro",
Expand Down Expand Up @@ -57,4 +59,4 @@
]
]
}
}
}
6 changes: 4 additions & 2 deletions samples/expo/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"name": "sentry-react-native-expo-sample",
"version": "1.0.0",
"version": "5.22.0",
"main": "expo-router/entry",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"ts:check": "tsc",
"export": "EXPO_SKIP_DURING_EXPORT='true' expo export --dump-sourcemap --clear"
"export": "EXPO_SKIP_DURING_EXPORT='true' expo export --dump-sourcemap --clear",
"set-version": "npm version --no-git-tag-version",
"postversion": "react-native-version --skip-tag --never-amend"
},
"dependencies": {
"@types/react": "18.2.45",
Expand Down
2 changes: 2 additions & 0 deletions samples/react-native/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ yarn-error.log

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

*.xcarchive
1 change: 1 addition & 0 deletions samples/react-native/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ruby "3.3.0"

gem 'cocoapods', '1.15.2'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
gem 'fastlane', '2.220.0'
Loading
Loading