Skip to content

Commit

Permalink
add plist
Browse files Browse the repository at this point in the history
  • Loading branch information
jyu115 committed Dec 7, 2023
1 parent b05d5b2 commit 1990483
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 15 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/ios-browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,42 @@ jobs:
ruby-version: "3.2.2"
bundler-cache: true
- run: brew install xcodesorg/made/xcodes
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
EXPORT_OPTIONS_PLIST: ${{ secrets.EXPORT_OPTIONS_PLIST }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import 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
# 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 certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
# create plist
EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
- name: fastlane build swift-sample-app
run: bundle exec fastlane build_for_browserstack
run: bundle exec fastlane build_for_browserstack plist:$EXPORT_OPTS_PATH

- name: upload swift-sample-app .ipa to browserstack
id: upload_ipa
Expand Down
16 changes: 4 additions & 12 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ default_platform(:ios)

platform :ios do
desc "build swift-sample-app .ipa and ui-test.zip for browserstack"
lane :build_for_browserstack do
lane :build_for_browserstack do |options|
xcodes(version: "14.2", select_for_current_build_only: true)
ensure_xcode_version(version: "14.2")
setup_ci
build_swift_sample_app
build_swift_sample_app(plist:options[:plist])
build_ui_tests
end

desc "build swift-sample-app .ipa"
lane :build_swift_sample_app do
lane :build_swift_sample_app do |options|
export_option(options[:plist])
build_app(
project: "sample-apps/swift-sample-app/swift-sample-app.xcodeproj",
configuration: "Debug",
Expand All @@ -23,15 +24,6 @@ platform :ios do
output_name: "swift-sample-app.ipa",
export_method: "development",
export_team_id: "BP98Z28R86",
skip_profile_detection: true,
export_options: {
signingStyle: "manual",
compileBitcode: false,
provisioningProfiles: {
"iterable.swift-sample-app" => "ios-dev-swift-sample-app",
"iterable.swift-sample-app.swift-sample-app-notification-extension" => "ios-dev-swift-sample-app-notification-extension"
},
}
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.iterable.swift-sample-app";
PRODUCT_BUNDLE_IDENTIFIER = "iterable.swift-sample-app";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -658,7 +658,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
MARKETING_VERSION = 1.0;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.iterable.sampleapp.swift.SwiftSampleAppUITest;
PRODUCT_BUNDLE_IDENTIFIER = "iterable.swift-sample-app.SwiftSampleAppUITest";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
Expand Down

0 comments on commit 1990483

Please sign in to comment.