Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
69 changes: 26 additions & 43 deletions .circleci/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ jobs:
command: bundle exec fastlane build_paywalls_tester_for_emerge
- slack-notify-on-fail

emerge_binary_size_analysis:
binary_size_analysis:
executor:
name: macos-executor
steps:
Expand All @@ -2017,8 +2017,8 @@ jobs:
- tuist-generate-workspace:
query: "BinarySizeTest"
- run:
name: Build BinarySizeTest (LOCAL_SOURCE) and upload to Emerge
command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:LOCAL_SOURCE
name: Build and upload BinarySizeTest (LOCAL_SOURCE)
command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:LOCAL_SOURCE

# CocoaPods
- run:
Expand All @@ -2029,8 +2029,8 @@ jobs:
- tuist-generate-workspace:
query: "BinarySizeTest"
- run:
name: Build BinarySizeTest (COCOAPODS) and upload to Emerge
command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:COCOAPODS
name: Build and upload BinarySizeTest (COCOAPODS)
command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:COCOAPODS

# SPM
- run:
Expand All @@ -2040,8 +2040,8 @@ jobs:
- tuist-generate-workspace:
query: "BinarySizeTest"
- run:
name: Build BinarySizeTest (SPM) and upload to Emerge
command: bundle exec fastlane build_and_upload_emerge_binary_size_analysis integration_method:SPM
name: Build and upload BinarySizeTest (SPM)
command: bundle exec fastlane build_and_upload_binary_size_analysis integration_method:SPM

record-and-upload-paywalls-v2-snapshots:
description: "Record paywall template screenshots and distribute them to the paywall-rendering-validation repository and/or Emerge"
Expand Down Expand Up @@ -2317,30 +2317,18 @@ workflows:
#
# Boolean parameters like generate_snapshots, generate_revenuecatui_snapshots,
# and generate_swiftinterface can be set to true from the CircleCI UI.
run-all-tests:
binary-size-analysis-test:
when:
and:
- not:
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
- not:
equal: ["release-train", << pipeline.schedule.name >>]
- not:
equal: [bump, << pipeline.parameters.action >>]
- not: << pipeline.parameters.generate_snapshots >>
- not: << pipeline.parameters.generate_revenuecatui_snapshots >>
- not: << pipeline.parameters.generate_swiftinterface >>
- not:
matches:
pattern: "^(main|release/.*)$"
value: << pipeline.git.branch >>
- or:
- not:
matches:
pattern: "^generated_(snapshots|swiftinterface)/.*"
value: << pipeline.git.branch >>
- matches:
pattern: "^generated_(snapshots|swiftinterface)/main-.*"
value: << pipeline.git.branch >>
equal: [rickvdl/migrate-sentry-size-analysis, << pipeline.git.branch >>]
jobs:
- binary_size_analysis:
context:
- slack-secrets
- sentry

# Temporarily disabled while validating the Sentry Size Analysis migration.
run-all-tests:
when: false
jobs:
# =============================================================
# Reduced Test Suite: Auto-run on every push
Expand Down Expand Up @@ -2369,9 +2357,10 @@ workflows:
- emerge_purchases_ui_snapshot_tests:
context:
- slack-secrets
- emerge_binary_size_analysis:
- binary_size_analysis:
context:
- slack-secrets
- sentry
- build-tv-watch-mac-and-visionos:
context:
- slack-secrets
Expand Down Expand Up @@ -2543,7 +2532,7 @@ workflows:
- pod-lib-lint
- run-revenuecat-ui-ios-26
- emerge_purchases_ui_snapshot_tests
- emerge_binary_size_analysis
- binary_size_analysis
- build-tv-watch-mac-and-visionos
- run-workflow-maestro-tests
# Full Test Suite
Expand Down Expand Up @@ -2639,15 +2628,8 @@ workflows:
<<: *only-main-branch

danger:
when:
or:
- not:
matches:
pattern: "^generated_(snapshots|swiftinterface)/.*"
value: << pipeline.git.branch >>
- matches:
pattern: "^generated_(snapshots|swiftinterface)/main-.*"
value: << pipeline.git.branch >>
# Temporarily disabled while validating the Sentry Size Analysis migration.
when: false
jobs:
- danger

Expand Down Expand Up @@ -2871,9 +2853,10 @@ workflows:
dry_run: true
context:
- slack-secrets
- emerge_binary_size_analysis:
- binary_size_analysis:
context:
- slack-secrets
- sentry
- lint:
context:
- slack-secrets
Expand Down Expand Up @@ -2931,7 +2914,7 @@ workflows:
- api-tests
- revenuecat-admob-tests
- deploy-purchase-tester
- emerge_binary_size_analysis
- binary_size_analysis

# =============================================================
# Release tagging: only on release branches.
Expand Down
2 changes: 1 addition & 1 deletion .circleci/generate-requested-jobs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const JOBS = {
"check-api-changes-revenuecat": ["slack-secrets-ios"],
"check-api-changes-revenuecatui": ["slack-secrets-ios"],
"docs-build": ["slack-secrets"],
"emerge_binary_size_analysis": ["slack-secrets"],
"binary_size_analysis": ["slack-secrets", "sentry"],
"emerge_purchases_ui_snapshot_tests": ["slack-secrets"],
"generate-swiftinterface": ["slack-secrets-ios"],
"installation-tests-all-but-carthage": ["slack-secrets"],
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ GEM
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-emerge (0.10.8)
faraday (~> 1.1)
fastlane-plugin-sentry (2.6.1)
os (~> 1.1, >= 1.1.4)
fastlane-sirp (1.1.0)
ffi (1.17.4)
ffi (1.17.4-arm64-darwin)
Expand Down Expand Up @@ -470,6 +472,7 @@ DEPENDENCIES
fastlane-plugin-create_xcframework!
fastlane-plugin-emerge
fastlane-plugin-revenuecat_internal!
fastlane-plugin-sentry
nokogiri
rest-client (= 2.1.0)

Expand Down
6 changes: 3 additions & 3 deletions Projects/BinarySizeTest/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import ProjectDescriptionHelpers
import Foundation

/// Unlike other Tuist projects in this repo, BinarySizeTest manages its own dependency integration
/// independently of `Environment.dependencyMode`. Each case produces a separate binary uploaded to
/// Emerge for size tracking, so they each have a distinct bundle ID.
/// independently of `Environment.dependencyMode`. Each case produces a separate binary for size
/// tracking, so they each have a distinct bundle ID.
///
/// - `localSource`: Uses Xcode project target references (`.project(target:path:)`).
/// Requires `TUIST_RC_XCODE_PROJECT=true` so that `Workspace.swift` includes the
Expand Down Expand Up @@ -82,7 +82,7 @@ extension BinarySizeTestIntegrationMethod {
}

var provisioningProfileSpecifier: String {
return "match AppStore \(bundleId)"
return "match AdHoc \(bundleId)"
}

var provisioningProfileSettingValue: SettingValue {
Expand Down
61 changes: 51 additions & 10 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ REPO_NAME = 'purchases-ios'
PAYWALL_PREVIEW_RESOURCES_REPO_NAME = 'paywall-preview-resources'
CHANGELOG_LATEST_PATH = './CHANGELOG.latest.md'
CHANGELOG_PATH = './CHANGELOG.md'
BINARY_SIZE_ANALYSIS_DEVICE = 'iPhone17,1'
BINARY_SIZE_ANALYSIS_CONFIGURATION = 'Release'
SENTRY_ORG_SLUG = 'revenuecat'
SENTRY_PROJECT_SLUG = 'purchases-ios'

platform :ios do
before_all do
Expand Down Expand Up @@ -955,22 +959,55 @@ platform :ios do
build_release(platform: 'macOS')
end

desc "Build BinarySizeTest app and upload to Emerge"
lane :build_and_upload_emerge_binary_size_analysis do |options|
desc "Build BinarySizeTest app and upload it for size analysis"
lane :build_and_upload_binary_size_analysis do |options|
integration_method = options[:integration_method]
unless integration_method
UI.user_error!("Missing required option: integration_method. Expected one of: LOCAL_SOURCE, COCOAPODS, SPM")
end

archive_path = build_binary_size_test_app(
build = build_binary_size_test_app(
integration_method: integration_method
)

send_to_emerge(
archive_path: archive_path
archive_path: build[:archive_path]
)

send_to_sentry(
ipa_path: build[:ipa_path]
)
end

private_lane :send_to_sentry do |options|
ipa_path = options[:ipa_path]
unless ipa_path && File.exist?(ipa_path)
UI.user_error!("Missing thinned IPA for Sentry upload at '#{ipa_path}'")
end

sentry_args = {
org_slug: SENTRY_ORG_SLUG,
project_slug: SENTRY_PROJECT_SLUG,
ipa_path: ipa_path,
build_configuration: BINARY_SIZE_ANALYSIS_CONFIGURATION,
vcs_provider: "github",
head_repo_name: "RevenueCat/#{REPO_NAME}",
base_repo_name: "RevenueCat/#{REPO_NAME}",
force_git_metadata: true
}

head_sha = ENV["CIRCLE_SHA1"]
sentry_args[:head_sha] = head_sha if head_sha && !head_sha.empty?

head_ref = ENV["CIRCLE_BRANCH"]
sentry_args[:head_ref] = head_ref if head_ref && !head_ref.empty?

pr_number = detect_pr_number
sentry_args[:pr_number] = pr_number if pr_number

sentry_upload_build(sentry_args)
end

private_lane :build_binary_size_test_app do |options|
integration_method = options[:integration_method]
unless integration_method
Expand Down Expand Up @@ -1020,10 +1057,10 @@ platform :ios do
end

bundle_id = settings[:bundle_id]
provisioning_profile_name = "match AppStore #{bundle_id}"
provisioning_profile_name = "match AdHoc #{bundle_id}"

match(
type: "appstore",
type: "adhoc",
readonly: true,
platform: "ios",
app_identifier: bundle_id,
Expand All @@ -1037,19 +1074,20 @@ platform :ios do
gym(
workspace: workspace_path,
scheme: "BinarySizeTest",
configuration: "Release",
configuration: BINARY_SIZE_ANALYSIS_CONFIGURATION,
destination: "generic/platform=iOS",
archive_path: archive_path,
export_method: "app-store",
export_method: "ad-hoc",
export_options: {
signingStyle: "manual",
stripSwiftSymbols: false,
thinning: "<none>",
thinning: BINARY_SIZE_ANALYSIS_DEVICE,
provisioningProfiles: {
bundle_id => provisioning_profile_name
}
},
output_directory: output_directory,
output_name: "BinarySizeTest-#{integration_method}-#{BINARY_SIZE_ANALYSIS_DEVICE}",
include_bitcode: false,
include_symbols: true,
clean: false
Expand All @@ -1060,7 +1098,10 @@ platform :ios do
UI.user_error!("IPA export completed but no IPA file found in lane context")
end

archive_path
{
archive_path: archive_path,
ipa_path: ipa_path
}
end

desc "archive"
Expand Down
1 change: 1 addition & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
gem 'fastlane-plugin-create_xcframework', git: "https://github.com/RevenueCat/fastlane-plugin-create_xcframework"
gem "fastlane-plugin-revenuecat_internal", git: "https://github.com/RevenueCat/fastlane-plugin-revenuecat_internal"
gem 'fastlane-plugin-emerge'
gem 'fastlane-plugin-sentry'
Loading