mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
BrowserStack support (#561)
* BrowserStack support * Add fastlane step to automatically upload builds to BrowserStack * Add error log for when Application Groups are not available * Use better applicationSupportDirectory API
This commit is contained in:
@@ -56,6 +56,8 @@ jobs:
|
|||||||
APPSTORECONNECT_KEY_CONTENT: ${{ secrets.APPSTORECONNECT_KEY_CONTENT }}
|
APPSTORECONNECT_KEY_CONTENT: ${{ secrets.APPSTORECONNECT_KEY_CONTENT }}
|
||||||
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
||||||
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
||||||
|
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
|
||||||
|
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
||||||
|
|
||||||
- name: Add release notes and Diawi info
|
- name: Add release notes and Diawi info
|
||||||
uses: NejcZdovc/comment-pr@v1
|
uses: NejcZdovc/comment-pr@v1
|
||||||
|
|||||||
@@ -28,8 +28,14 @@ extension URL {
|
|||||||
/// The URL of the primary app group container.
|
/// The URL of the primary app group container.
|
||||||
static var appGroupContainerDirectory: URL {
|
static var appGroupContainerDirectory: URL {
|
||||||
guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: InfoPlistReader.main.appGroupIdentifier) else {
|
guard let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: InfoPlistReader.main.appGroupIdentifier) else {
|
||||||
fatalError("Should always be able to retrieve the container directory")
|
MXLog.error("Application Group unavailable, falling back to the application folder")
|
||||||
|
// Browserstack doesn't properly handle AppGroup entitlements so this fails, presumably because of the resigning happening on their side
|
||||||
|
// Try using the normal app folder instead of the app group
|
||||||
|
// https://www.browserstack.com/docs/app-automate/appium/troubleshooting/entitlements-error
|
||||||
|
|
||||||
|
return URL.applicationSupportDirectory.deletingLastPathComponent().deletingLastPathComponent()
|
||||||
}
|
}
|
||||||
|
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,8 @@ GEM
|
|||||||
xcpretty (~> 0.3.0)
|
xcpretty (~> 0.3.0)
|
||||||
xcpretty-travis-formatter (>= 0.0.3)
|
xcpretty-travis-formatter (>= 0.0.3)
|
||||||
fastlane-plugin-brew (0.1.1)
|
fastlane-plugin-brew (0.1.1)
|
||||||
|
fastlane-plugin-browserstack (0.3.2)
|
||||||
|
rest-client (~> 2.0, >= 2.0.2)
|
||||||
fastlane-plugin-diawi (2.1.0)
|
fastlane-plugin-diawi (2.1.0)
|
||||||
rest-client (>= 2.0.0)
|
rest-client (>= 2.0.0)
|
||||||
fastlane-plugin-sentry (1.15.0)
|
fastlane-plugin-sentry (1.15.0)
|
||||||
@@ -254,6 +256,7 @@ PLATFORMS
|
|||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
fastlane
|
fastlane
|
||||||
|
fastlane-plugin-browserstack
|
||||||
fastlane-plugin-diawi
|
fastlane-plugin-diawi
|
||||||
fastlane-plugin-sentry
|
fastlane-plugin-sentry
|
||||||
fastlane-plugin-xcodegen
|
fastlane-plugin-xcodegen
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ lane :alpha do
|
|||||||
)
|
)
|
||||||
|
|
||||||
upload_to_diawi()
|
upload_to_diawi()
|
||||||
|
|
||||||
|
upload_to_browserstack()
|
||||||
end
|
end
|
||||||
|
|
||||||
lane :app_store_release do
|
lane :app_store_release do
|
||||||
@@ -279,6 +281,21 @@ private_lane :upload_to_diawi do
|
|||||||
sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV")
|
sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private_lane :upload_to_browserstack do
|
||||||
|
browserstack_username = ENV["BROWSERSTACK_USERNAME"]
|
||||||
|
UI.user_error!("Invalid BrowserStack username.") unless !browserstack_username.to_s.empty?
|
||||||
|
|
||||||
|
browserstack_access_key = ENV["BROWSERSTACK_ACCESS_KEY"]
|
||||||
|
UI.user_error!("Invalid BrowserStack access key.") unless !browserstack_access_key.to_s.empty?
|
||||||
|
|
||||||
|
upload_to_browserstack_app_automate(
|
||||||
|
browserstack_username: browserstack_username,
|
||||||
|
browserstack_access_key: browserstack_access_key,
|
||||||
|
file_path: lane_context[SharedValues::IPA_OUTPUT_PATH],
|
||||||
|
custom_id: "element-x-ios-pr"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
private_lane :bump_build_number do
|
private_lane :bump_build_number do
|
||||||
# Increment build number to current date
|
# Increment build number to current date
|
||||||
build_number = Time.now.strftime("%Y%m%d%H%M")
|
build_number = Time.now.strftime("%Y%m%d%H%M")
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
gem 'fastlane-plugin-diawi'
|
gem 'fastlane-plugin-diawi'
|
||||||
gem 'fastlane-plugin-xcodegen'
|
gem 'fastlane-plugin-xcodegen'
|
||||||
gem 'fastlane-plugin-sentry'
|
gem 'fastlane-plugin-sentry'
|
||||||
|
gem 'fastlane-plugin-browserstack'
|
||||||
|
|||||||
Reference in New Issue
Block a user