Skip to content

Generate assets #136

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

Merged
merged 40 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a1594f0
Update Crash CoreData and Data Model
melekr Jul 15, 2024
3431fa5
Migrate Backtrace.podspec resources attribute to multi-platform resou…
melekr Jul 15, 2024
367e24a
Add pod lib lint command to workflows and scripts
melekr Jul 15, 2024
ac01943
Add BacktraceResources bundle
melekr Jul 16, 2024
66179f9
Specify Podfile project .xcworkspace
melekr Jul 16, 2024
4198a7f
Update project.pbxproj
melekr Jul 16, 2024
9a464a5
Update github workflows
melekr Jul 16, 2024
6b63060
Update deploy.yml
melekr Jul 16, 2024
70a771a
Update deploy.sh
melekr Jul 16, 2024
83f654d
Bump backtraceVersion and update changelog
melekr Jul 16, 2024
f743a72
Create xcframeworks
melekr Jul 26, 2024
6eb59cb
Disable CODE_SIGNING for bundle
melekr Jul 26, 2024
8a6bfee
Update project.pbxproj
melekr Jul 26, 2024
3ab83b0
Update project.pbxproj
melekr Jul 26, 2024
0c36aea
Update deploy.yml
melekr Jul 27, 2024
f799b71
Copy dependency framework
melekr Jul 30, 2024
2feeac8
Update deploy.yml
melekr Jul 31, 2024
56bcd6c
Update deploy.yml
melekr Jul 31, 2024
9ba19ed
Update deploy.yml
melekr Jul 31, 2024
400c7b1
Update deploy.yml
melekr Jul 31, 2024
cb9eb5a
Update deploy.yml
melekr Jul 31, 2024
7eadb39
Disable Bundle automatic signing
melekr Jul 31, 2024
21b8724
Update project.pbxproj
melekr Jul 31, 2024
ca93b7b
Update Podfile
melekr Aug 1, 2024
ee70a1a
Update deploy.yml
melekr Aug 1, 2024
eeb703c
Update deploy.yml
melekr Aug 1, 2024
aacfa85
Update xcframeworkgen.sh
melekr Aug 1, 2024
1a102b4
Add macos signing and provisioning
melekr Aug 1, 2024
022e20b
Update project.pbxproj
melekr Aug 1, 2024
c1f56b2
Remove unused vendored framework
melekr Aug 2, 2024
1b13b09
Add Simulator support
melekr Aug 2, 2024
9b4b9c2
Set DEVELOPMENT_TEAM secret
melekr Aug 2, 2024
e1782ad
Update Build frameworks step
melekr Aug 2, 2024
2bc4b39
Use vars instead of secrets
melekr Aug 2, 2024
ada7457
Update DEVELOPMENT_TEAM
melekr Aug 2, 2024
4e873d8
Merge branch 'master' into generate-assets
melekr Aug 5, 2024
633d662
Delete Podfile
melekr Aug 5, 2024
5ab00e5
Bump sdk version and update Changelog
melekr Aug 5, 2024
2c902c1
Exit when xcframework is not generated
melekr Aug 6, 2024
8116ae8
Restore pod trunk
melekr Aug 6, 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
98 changes: 93 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
platform: [ios, mac, tvos]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: sh scripts/install.sh
- name: Run test
Expand All @@ -26,22 +26,110 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: sh scripts/install.sh
- name: Run pod lib lint
run: pod lib lint --verbose --allow-warnings --sources='https://cdn.cocoapods.org/'
run: pod lib lint --verbose --allow-warnings --sources='https://cdn.cocoapods.org/'
# END COPY PASTE FROM TEST.YML

deploy-cocoapods:
runs-on: macos-latest
needs: [pod-lint, test]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: sh scripts/install.sh
- name: Deploy to Cocoapods
run: sh scripts/deploy.sh
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}

sign-and-build-frameworks:
runs-on: macos-latest
needs: [pod-lint, test]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pods
run: pod install
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
MAC_BUILD_CERTIFICATE_BASE64: ${{ secrets.MAC_BUILD_CERTIFICATE_BASE64 }}
MAC_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.MAC_BUILD_PROVISION_PROFILE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision

MAC_CERTIFICATE_PATH=$RUNNER_TEMP/mac_build_certificate.p12
MAC_PP_PATH=$RUNNER_TEMP/mac_build_pp.provisionprofile

KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db

# import iOS certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH

# import macOS certificate and provisioning profile from secrets
echo -n "$MAC_BUILD_CERTIFICATE_BASE64" | base64 --decode -o $MAC_CERTIFICATE_PATH
echo -n "$MAC_BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $MAC_PP_PATH

# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

# import iOS certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

# import macOS certificate to keychain
security import $MAC_CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH

# apply provisioning profiles
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $MAC_PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles

- name: Build frameworks
run: sh scripts/xcframeworkgen.sh
env:
BACKTRACE_VERSION: ${{ github.ref_name }}

- name: Tar files to preserve file permissions
run: tar -cvzf Archive_XCFrameworks_${{ github.ref_name }}.tar.gz frameworks/

- uses: actions/upload-artifact@v4
with:
name: Archive_XCFrameworks_${{ github.ref_name }}
path: Archive_XCFrameworks_${{ github.ref_name }}.tar.gz

upload-xcframeworks:
runs-on: ubuntu-latest
needs: sign-and-build-frameworks

steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4
id: download
with:
path: artifacts/

- uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: ${{ steps.download.outputs.download-path }}
draft: true
verbose: env.ACTIONS_STEP_DEBUG
2 changes: 1 addition & 1 deletion Backtrace.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Pod::Spec.new do |s|

s.name = "Backtrace"
s.version = "2.0.5"
s.version = "2.0.5-alpha1"
s.swift_version = '5'
s.summary = "Backtrace's integration with iOS, macOS and tvOS"
s.description = "Reliable crash and hang reporting for iOS, macOS and tvOS."
Expand Down
38 changes: 30 additions & 8 deletions Backtrace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@
F2D8BE4F21BDA7D0007CFEFA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F2D8BE5021BDA7D0007CFEFA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
F2D8BE5221BDA7D0007CFEFA /* Example_macOS_ObjC.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Example_macOS_ObjC.entitlements; sourceTree = "<group>"; };
F2D8BF1B21BDBA5B007CFEFA /* CrashReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CrashReporter.framework; path = Vendor/macOS/CrashReporter.framework; sourceTree = "<group>"; };
F2D8BF1D21BDBB93007CFEFA /* CrashReporter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CrashReporter.framework; path = Vendor/iOS/CrashReporter.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -1100,8 +1098,6 @@
F2D56BC721BBEE2E007D4A03 /* Frameworks */ = {
isa = PBXGroup;
children = (
F2D8BF1D21BDBB93007CFEFA /* CrashReporter.framework */,
F2D8BF1B21BDBA5B007CFEFA /* CrashReporter.framework */,
81F19800C7ECF089E0EEBFDF /* Pods_Backtrace_iOS.framework */,
43E3476EC18BF98BEF9DBA61 /* Pods_Backtrace_iOSTests.framework */,
A029D9F3B2C21AAB02251487 /* Pods_Backtrace_macOS.framework */,
Expand Down Expand Up @@ -2456,13 +2452,25 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=driverkit*]" = "-";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=xros*]" = "Apple Development";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=appletvos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=driverkit*]" = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=macosx*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=watchos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=xros*]" = JWKXD469L2;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand Down Expand Up @@ -2491,8 +2499,9 @@
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Backtrace.BacktraceResources;
PRODUCT_BUNDLE_IDENTIFIER = Backtrace.io.BacktraceResources;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "xrsimulator xros watchsimulator watchos macosx iphonesimulator iphoneos driverkit appletvsimulator appletvos";
Expand Down Expand Up @@ -2537,12 +2546,24 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=driverkit*]" = "-";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "3rd Party Mac Developer Application";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=xros*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=appletvos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=driverkit*]" = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=macosx*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=watchos*]" = JWKXD469L2;
"DEVELOPMENT_TEAM[sdk=xros*]" = JWKXD469L2;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
Expand All @@ -2564,8 +2585,9 @@
MARKETING_VERSION = 1.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = Backtrace.BacktraceResources;
PRODUCT_BUNDLE_IDENTIFIER = Backtrace.io.BacktraceResources;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "xrsimulator xros watchsimulator watchos macosx iphonesimulator iphoneos driverkit appletvsimulator appletvos";
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Backtrace Cocoa Release Notes

## Version 2.0.5-alpha1
- Distributes XCFramework (#137)

## Version 2.0.5
- Enables client side unwinding default setting (#134)
- Fixes Cocoapods deployment (#135)
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PODS:
- Backtrace (2.0.4):
- Backtrace (2.0.5-alpha1):
- PLCrashReporter (= 1.11)
- Nimble (10.0.0)
- PLCrashReporter (1.11.0)
Expand All @@ -22,7 +22,7 @@ EXTERNAL SOURCES:
:path: "./Backtrace.podspec"

SPEC CHECKSUMS:
Backtrace: a90dcc0f33cb29155c5b15209fbb5be30137ad29
Backtrace: 0ae754187513e780c86fc82c9a4a2e7710f595d0
Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84
PLCrashReporter: 7a9dff14a23ba5d2e28c6160f0bb6fada5e71a8d
Quick: 749aa754fd1e7d984f2000fe051e18a3a9809179
Expand Down
2 changes: 1 addition & 1 deletion Sources/Features/Attributes/DefaultAttributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ struct LibInfo: AttributesSource {
private static let applicationGuidKey = "backtrace.unique.user.identifier"
private static let applicationLangName = "backtrace-cocoa"

var backtraceVersion = "2.0.5"
var backtraceVersion = "2.0.5-alpha1"

var immutable: [String: Any?] {
return ["guid": LibInfo.guid(store: UserDefaultsStore.self).uuidString,
Expand Down
2 changes: 1 addition & 1 deletion scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -o xtrace # to trace what gets executed. Useful for debugging

# This script requires the `COCOAPODS_TRUNK_TOKEN` env var to be set.
# See more: https://fuller.li/posts/automated-cocoapods-releases-with-ci/.
pod trunk push Backtrace.podspec --allow-warnings
#pod trunk push Backtrace.podspec --allow-warnings
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled not to publish alpha pre-release

82 changes: 82 additions & 0 deletions scripts/xcframeworkgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

PROJECT_DIR="$(dirname "$0")/.."
BUILD_PATH="${PROJECT_DIR}/.build"
WORKFLOW_XC_PATH="${PROJECT_DIR}/frameworks"
POD_PATH="${PROJECT_DIR}/Pods/PLCrashReporter"
DERIVED_DATA_PATH="${PROJECT_DIR}/.derivedData"

rm -rf ${BUILD_PATH}
rm -rf ${WORKFLOW_XC_PATH}
rm -rf ${DERIVED_DATA_PATH}
mkdir ${BUILD_PATH}
mkdir ${WORKFLOW_XC_PATH}
mkdir ${DERIVED_DATA_PATH}

xcodebuild archive \
-workspace Backtrace.xcworkspace \
-scheme "Backtrace-iOS-lib" \
-destination "generic/platform=iOS" \
-archivePath ${BUILD_PATH}/Backtrace-iOS-lib.xcarchive \
-derivedDataPath ${DERIVED_DATA_PATH} \
-configuration Release \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO

xcodebuild archive \
-workspace Backtrace.xcworkspace \
-scheme "Backtrace-iOS-lib" \
-destination "generic/platform=iOS Simulator" \
-archivePath ${BUILD_PATH}/Backtrace-iOS-Simulator-lib.xcarchive \
-derivedDataPath ${DERIVED_DATA_PATH} \
-configuration Release \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO

xcodebuild archive \
-workspace Backtrace.xcworkspace \
-scheme "Backtrace-macOS-lib" \
-destination "platform=macOS" \
-archivePath ${BUILD_PATH}/Backtrace-macOS-lib.xcarchive \
-derivedDataPath ${DERIVED_DATA_PATH} \
-configuration Release \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO

xcodebuild archive \
-workspace Backtrace.xcworkspace \
-scheme "Backtrace-tvOS-lib" \
-destination "generic/platform=tvOS" \
-archivePath ${BUILD_PATH}/Backtrace-tvOS-lib.xcarchive \
-derivedDataPath ${DERIVED_DATA_PATH} \
-configuration Release \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO

xcodebuild archive \
-workspace Backtrace.xcworkspace \
-scheme "Backtrace-tvOS-lib" \
-destination "generic/platform=tvOS Simulator" \
-archivePath ${BUILD_PATH}/Backtrace-tvOS-Simulator-lib.xcarchive \
-derivedDataPath ${DERIVED_DATA_PATH} \
-configuration Release \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" GCC_GENERATE_DEBUGGING_SYMBOLS=YES \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES SKIP_INSTALL=NO

xcodebuild -create-xcframework \
-archive ${BUILD_PATH}/Backtrace-iOS-lib.xcarchive -framework Backtrace.framework \
-archive ${BUILD_PATH}/Backtrace-iOS-Simulator-lib.xcarchive -framework Backtrace.framework \
-archive ${BUILD_PATH}/Backtrace-macOS-lib.xcarchive -framework Backtrace.framework \
-archive ${BUILD_PATH}/Backtrace-tvOS-lib.xcarchive -framework Backtrace.framework \
-archive ${BUILD_PATH}/Backtrace-tvOS-Simulator-lib.xcarchive -framework Backtrace.framework \
-output ${WORKFLOW_XC_PATH}/Backtrace.xcframework

rm -rf ${BUILD_PATH}
rm -rf ${DERIVED_DATA_PATH}

if [ ! -d "$POD_PATH" ]; then
echo "Error: Source directory '$POD_PATH' does not exist."
exit 1
fi

cp -r "$POD_PATH" "$WORKFLOW_XC_PATH"
Loading