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

ci: Use BCSymbolMaps for processing dSYMs #973

Merged
merged 32 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
438295c
ci: Upload BCSymbolMaps to Sentry
Feb 16, 2021
d87c679
Install sentry-cli via brew
Feb 16, 2021
899eb56
Only download current dSYMS
Feb 17, 2021
0c790cb
Fix uploading artifacts
Feb 17, 2021
68b40df
Use dSYMs path
Feb 17, 2021
3ae1fd8
mkdir
Feb 17, 2021
b26b0f1
Add dSyms to archives
Feb 17, 2021
7667fc2
All files in dSYMs
Feb 17, 2021
8566931
Another fix
Feb 17, 2021
cc0fc2c
fix the fix
Feb 17, 2021
d9901a5
hard code
Feb 17, 2021
535e33a
Try to fix
Feb 17, 2021
3da742f
Fix
Feb 17, 2021
7faf681
Change files
Feb 18, 2021
e31e978
Fix
Feb 18, 2021
e922f1f
Fix build number
Feb 18, 2021
99bb224
fix run number
Feb 18, 2021
29d50b7
uncomment
Feb 18, 2021
6cb9005
Merge branch 'master' into ci/upload-bcsymbolmaps
Feb 25, 2021
c4d691d
Merge branch 'master' into ci/upload-bcsymbolmaps
Mar 1, 2021
1252c9a
ci: Fix TestFlight upload for previews
Mar 3, 2021
bfccc44
Merge branch 'master' into ci/fix-app-store-connect-upload
philipphofmann Mar 3, 2021
16a044b
Merge branch 'ci/fix-app-store-connect-upload' into ci/upload-bcsymbo…
Mar 3, 2021
30e6c36
Try on CI
Mar 3, 2021
2e07c9a
Merge branch 'ci/fix-app-store-connect-upload' of github.com:getsentr…
Mar 3, 2021
efb7102
Remove preview version suffix also for Sentry
philipphofmann Mar 3, 2021
0a260c4
BundleVersion
philipphofmann Mar 3, 2021
8673bbd
Merge branch 'ci/fix-app-store-connect-upload' into ci/upload-bcsymbo…
philipphofmann Mar 3, 2021
0d64d08
Another Fix
philipphofmann Mar 3, 2021
d0afaff
Undo changes in ViewController
philipphofmann Mar 3, 2021
0e73560
Remove CI branch
philipphofmann Mar 3, 2021
13731bf
Merge branch 'master' into ci/upload-bcsymbolmaps
philipphofmann Mar 4, 2021
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
19 changes: 18 additions & 1 deletion .github/workflows/testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,30 @@ jobs:
with:
ruby-version: '2.7'

- name: Install SentryCli
run: brew install getsentry/tools/sentry-cli

- name: Setup fastlane
run: bundle install

# We upload a new version to TestFlight on every commit on Master
# So we need to bump the bundle version each time
- name: Bump Bundle Version
env:
FASTLANE_BUNDLE_VERSION: $GITHUB_RUN_NUMBER
FASTLANE_BUNDLE_VERSION: ${{ github.run_number }}
run: bundle exec fastlane bump_bundle_version
shell: sh

- name: Remove preview version suffixes
run: bundle exec fastlane remove_preview_version_suffixes
shell: sh

- name: Run Fastlane
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_BUNDLE_VERSION: ${{ github.run_number }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }}
Expand All @@ -64,3 +72,12 @@ jobs:
run: bundle exec fastlane ios_swift_to_testflight
shell: sh

- name: Archiving
uses: actions/upload-artifact@v2
with:
name: dSYMs
path: |
${{ github.workspace }}/iOS-Swift.*
${{ github.workspace }}/*.dSYM.zip
${{ github.workspace }}/dSYMs/

3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ gem "bundler", ">= 2"
gem "cocoapods", ">= 1.9.1"
gem "fastlane"
gem "rest-client"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-sentry (1.8.0)
ffi (1.14.2)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
Expand Down Expand Up @@ -272,6 +273,7 @@ DEPENDENCIES
bundler (>= 2)
cocoapods (>= 1.9.1)
fastlane
fastlane-plugin-sentry
rest-client

BUNDLED WITH
Expand Down
4 changes: 2 additions & 2 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 7.0.0-alpha.0;
MARKETING_VERSION = "7.0.0-alpha.0";
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
Expand All @@ -423,7 +423,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 7.0.0-alpha.0;
MARKETING_VERSION = "7.0.0-alpha.0";
PRODUCT_BUNDLE_IDENTIFIER = "io.sentry.sample.iOS-Swift";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "match AppStore io.sentry.sample.iOS-Swift";
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ViewController: UIViewController {
}
// Also works
let user = Sentry.User(userId: "1")
user.email = "tony@example.com"
user.email = "tony1@example.com"
SentrySDK.setUser(user)
}

Expand Down
4 changes: 1 addition & 3 deletions Utils/VersionBump/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ let package = Package(
.executable(name: "VersionBump", targets: ["VersionBump"])
],
dependencies: [
// We need to use the 5.1.0-beta.1, because otherwise we can't compile with Swift 5.3
// see https://github.com/kareman/SwiftShell/releases/tag/5.1.0-beta.1
.package(url: "https://github.com/kareman/SwiftShell.git", from: "5.1.0-beta.1"),
.package(url: "https://github.com/kareman/SwiftShell.git", from: "5.1.0"),
.package(url: "https://github.com/sharplet/Regex.git", from: "2.1.1")
],
targets: [
Expand Down
16 changes: 10 additions & 6 deletions Utils/VersionBump/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ for match in Regex(semver, options: [.dotMatchesLineSeparators]).allMatches(in:
let toVersion = args[1]

for file in files {
let readFile = try open(file)
let contents: String = readFile.read()
let newContents = contents.replacingOccurrences(of: fromVersion, with: toVersion)
let overwriteFile = try! open(forWriting: file, overwrite: true)
overwriteFile.write(newContents)
overwriteFile.close()
try updateVersion(file, fromVersion, toVersion)
}
}

func updateVersion(_ file: String, _ fromVersion: String, _ toVersion: String) throws {
let readFile = try open(file)
let contents: String = readFile.read()
let newContents = contents.replacingOccurrences(of: fromVersion, with: toVersion)
let overwriteFile = try! open(forWriting: file, overwrite: true)
overwriteFile.write(newContents)
overwriteFile.close()
}
44 changes: 39 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,40 @@ platform :ios do
app_identifier = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id)

ioSwiftInfoPlistPath = "./Samples/iOS-Swift/iOS-Swift/Info.plist"

lane :bump_bundle_version do
set_info_plist_value(
path: "./Samples/iOS-Swift/iOS-Swift/Info.plist",
path: ioSwiftInfoPlistPath,
key: "CFBundleVersion",
value: ENV["FASTLANE_BUNDLE_VERSION"]
)

end

# The version for all Info.plist must be a period-separated list of at most three non-negative integers
# for App Store Connect. If we are on a preview we to remove these suffixes.
lane :remove_preview_version_suffixes do
version = get_version_number(xcodeproj: "./Samples/iOS-Swift/iOS-Swift.xcodeproj")
version = version.split("-", -1)[0]

set_info_plist_value(
path: ioSwiftInfoPlistPath,
key: "CFBundleShortVersionString",
value: version
)

sentryInfoPlistPath = "./Sources/Sentry/Info.plist"
set_info_plist_value(
path: sentryInfoPlistPath,
key: "CFBundleShortVersionString",
value: version
)
set_info_plist_value(
path: sentryInfoPlistPath,
key: "CFBundleVersion",
value: version
)
end

desc "Upload iOS-Swift to TestFlight and symbols to Sentry"
Expand Down Expand Up @@ -44,17 +72,23 @@ platform :ios do
provisioningProfiles: {
app_identifier => "match AppStore io.sentry.sample.iOS-Swift"
}
}
},
archive_path: "iOS-Swift"
)

testflight
download_dsyms(wait_for_dsym_processing: true)
upload_symbols_to_sentry(

download_dsyms(
wait_for_dsym_processing: true,
build_number: ENV["FASTLANE_BUNDLE_VERSION"]
)

sentry_upload_dsym(
auth_token: ENV["SENTRY_AUTH_TOKEN"],
org_slug: 'sentry-sdks',
project_slug: 'sentry-cocoa',
symbol_maps: 'iOS-Swift.xcarchive/BCSymbolMaps/'
)
clean_build_artifacts
end

end
5 changes: 5 additions & 0 deletions fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-sentry'