-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): Add RN Sample Apple Testflight upload (#3764)
- Loading branch information
1 parent
aaecd92
commit d20a569
Showing
10 changed files
with
384 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
README.md | ||
*.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
itc_team_id("96157806") # App Store Connect Team ID | ||
team_id("97JCY7859U") # Developer Portal Team ID | ||
|
||
# For more information about the Appfile, see: | ||
# https://docs.fastlane.tools/advanced/#appfile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
default_platform(:ios) | ||
|
||
platform :ios do | ||
|
||
desc "Build React Native Sample" | ||
lane :build_react_native_sample do | ||
setup_ci | ||
|
||
sync_code_signing( | ||
type: "appstore", | ||
readonly: true, | ||
app_identifier: ["io.sentry.reactnative.sample"] | ||
) | ||
|
||
build_app( | ||
workspace: "ios/sentryreactnativesample.xcworkspace", | ||
scheme: "sentryreactnativesample", | ||
configuration: "Release", | ||
include_bitcode: false, | ||
include_symbols: true, | ||
export_method: "app-store", | ||
archive_path: "sentryreactnativesample" | ||
) | ||
|
||
delete_keychain(name: "fastlane_tmp_keychain") unless is_ci | ||
end | ||
|
||
desc "Upload React Native Sample to TestFlight" | ||
lane :upload_react_native_sample_to_testflight do | ||
|
||
app_store_connect_api_key( | ||
key_id: ENV["APP_STORE_CONNECT_KEY_ID"], | ||
issuer_id: ENV["APP_STORE_CONNECT_ISSUER_ID"], | ||
key_content: ENV["APP_STORE_CONNECT_KEY"] | ||
) | ||
|
||
testflight( | ||
skip_waiting_for_build_processing: true, | ||
) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
git_url("[email protected]:getsentry/codesigning.git") | ||
storage_mode("git") | ||
username("[email protected]") # Your Apple Developer Portal username | ||
|
||
# The docs are available on https://docs.fastlane.tools/actions/match |
Oops, something went wrong.