Skip to content

Commit 58084e8

Browse files
authored
Strip Cocoapods frameworks on build (home-assistant#2234)
## Summary Cocoapods does not strip the .frameworks it creates, which was done for us automatically when we were submitting using Bitcode, but upgrading to Xcode 14 means that no longer happens for us. ## Any other notes I think the tides are shifting strongly towards moving back to SPM, which hopefully (lol) would be less buggy than the last time we tried it. Outstanding Cocoapods issue for this one: CocoaPods/CocoaPods#10277
1 parent c82c5db commit 58084e8

File tree

7 files changed

+46
-7
lines changed

7 files changed

+46
-7
lines changed

.github/workflows/distribute.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ jobs:
4848
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
4949
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
5050
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
51+
EMERGE_REPO_NAME: ${{ github.repository }}
52+
EMERGE_SHA: ${{ github.sha }}
5153
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
5254
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
5355
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs

.github/workflows/size.yml

+29-3
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,41 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v3
1919

20+
- uses: actions/cache@v3
21+
name: "Cache: Pods"
22+
id: cache_pods
23+
with:
24+
path: |
25+
Pods
26+
Tools/MaterialDesignIcons.ttf
27+
Tools/MaterialDesignIcons.json
28+
key: >-
29+
${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
30+
${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}
31+
32+
- uses: actions/cache@v3
33+
name: "Cache: Gems"
34+
id: cache_gems
35+
with:
36+
path: vendor/bundle
37+
key: >-
38+
${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ env.DEVELOPER_DIR }}-${{ hashFiles('**/Gemfile.lock') }}
39+
2040
- name: Install Brews
41+
# right now, we don't need anything from brew for sizing, so save some time
42+
if: ${{ false }}
2143
run: brew bundle
2244

2345
- name: Install Gems
46+
if: steps.cache_gems.outputs.cache-hit != 'true'
2447
run: bundle install --jobs 4 --retry 3
2548

26-
- name: Install Pods
49+
- name: Install Pods Release
50+
if: steps.cache_pods.outputs.cache-hit != 'true'
2751
run: bundle exec pod install --repo-update
2852

2953
- name: Build app
30-
run: |
31-
bundle exec fastlane ios size
54+
run: bundle exec fastlane ios size
3255
env:
3356
P12_KEY_IOS_APP_STORE: ${{ secrets.P12_KEY_IOS_APP_STORE }}
3457
P12_KEY_MAC_APP_STORE: ${{ secrets.P12_KEY_MAC_APP_STORE }}
@@ -37,5 +60,8 @@ jobs:
3760
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
3861
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
3962
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
63+
EMERGE_REPO_NAME: ${{ github.repository }}
64+
EMERGE_PR_NUMBER: ${{ github.event.number }}
65+
EMERGE_SHA: ${{ github.sha }}
4066
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs
4167
SENTRY_PROJECT: ios

Brewfile

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
tap 'lokalise/cli-2'
2-
tap 'getsentry/tools'
32
brew 'lokalise2'
4-
brew 'sentry-cli'

Configuration/HomeAssistant.debug.xcconfig

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ PROVISIONING_PROFILE_SPECIFIER_QMQYCKL255_Extensions_PushProvider = Local Develo
88
// apple did not give us the device name permission in the dev app
99
ENABLE_DEVICE_NAME_QMQYCKL255 = 0
1010

11+
STRIP_INSTALLED_PRODUCT = NO
12+
1113
BUNDLE_ID_SUFFIX = .dev
1214
VALIDATE_PRODUCT = NO
1315
DEBUG_INFORMATION_FORMAT = dwarf

Podfile

+5
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ post_install do |installer|
116116

117117
# disabled arch to stay under the 75 MB limit imposed by apple
118118
config.build_settings['EXCLUDED_ARCHS[sdk=watchos*]'] = 'arm64'
119+
120+
next unless config.name == 'Release'
121+
122+
# cocoapods defaults to not stripping the frameworks it creates
123+
config.build_settings['STRIP_INSTALLED_PRODUCT'] = 'YES'
119124
end
120125

121126
# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'

Podfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,6 @@ SPEC CHECKSUMS:
223223
XCGLogger: 1943831ef907df55108b0b18657953f868de973b
224224
ZIPFoundation: 063163dc828bf699c5be160eb4f58f676322d94f
225225

226-
PODFILE CHECKSUM: 66c7e5daaace3b4e0564d0dc2b3d0bc3117f5973
226+
PODFILE CHECKSUM: b93796cf4d894cdfad74a3b1d5c98991aaf1cd77
227227

228228
COCOAPODS: 1.11.3

fastlane/Fastfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,13 @@ platform :ios do
505505
provisioningProfiles: specifiers
506506
}
507507
)
508-
emerge if ENV['EMERGE_API_TOKEN']
508+
if ENV['EMERGE_API_TOKEN']
509+
emerge(
510+
repo_name: ENV.fetch('EMERGE_REPO_NAME', nil),
511+
pr_number: ENV.fetch('EMERGE_PR_NUMBER', nil),
512+
sha: ENV.fetch('EMERGE_SHA', nil)
513+
)
514+
end
509515
ipa_path
510516
end
511517

0 commit comments

Comments
 (0)