Skip to content

Commit

Permalink
Strip Cocoapods frameworks on build (#2234)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
zacwest authored Oct 20, 2022
1 parent c82c5db commit 58084e8
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
EMERGE_REPO_NAME: ${{ github.repository }}
EMERGE_SHA: ${{ github.sha }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs
Expand Down
32 changes: 29 additions & 3 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,41 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: actions/cache@v3
name: "Cache: Pods"
id: cache_pods
with:
path: |
Pods
Tools/MaterialDesignIcons.ttf
Tools/MaterialDesignIcons.json
key: >-
${{ runner.os }}-pods-${{ env.DEVELOPER_DIR }}-
${{ hashFiles('**/Gemfile.lock', '**/Podfile.lock', 'Tools/BuildMaterialDesignIconsFont.sh') }}
- uses: actions/cache@v3
name: "Cache: Gems"
id: cache_gems
with:
path: vendor/bundle
key: >-
${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ env.DEVELOPER_DIR }}-${{ hashFiles('**/Gemfile.lock') }}
- name: Install Brews
# right now, we don't need anything from brew for sizing, so save some time
if: ${{ false }}
run: brew bundle

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

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

- name: Build app
run: |
bundle exec fastlane ios size
run: bundle exec fastlane ios size
env:
P12_KEY_IOS_APP_STORE: ${{ secrets.P12_KEY_IOS_APP_STORE }}
P12_KEY_MAC_APP_STORE: ${{ secrets.P12_KEY_MAC_APP_STORE }}
Expand All @@ -37,5 +60,8 @@ jobs:
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
EMERGE_REPO_NAME: ${{ github.repository }}
EMERGE_PR_NUMBER: ${{ github.event.number }}
EMERGE_SHA: ${{ github.sha }}
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs
SENTRY_PROJECT: ios
2 changes: 0 additions & 2 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
tap 'lokalise/cli-2'
tap 'getsentry/tools'
brew 'lokalise2'
brew 'sentry-cli'
2 changes: 2 additions & 0 deletions Configuration/HomeAssistant.debug.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ PROVISIONING_PROFILE_SPECIFIER_QMQYCKL255_Extensions_PushProvider = Local Develo
// apple did not give us the device name permission in the dev app
ENABLE_DEVICE_NAME_QMQYCKL255 = 0

STRIP_INSTALLED_PRODUCT = NO

BUNDLE_ID_SUFFIX = .dev
VALIDATE_PRODUCT = NO
DEBUG_INFORMATION_FORMAT = dwarf
Expand Down
5 changes: 5 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ post_install do |installer|

# disabled arch to stay under the 75 MB limit imposed by apple
config.build_settings['EXCLUDED_ARCHS[sdk=watchos*]'] = 'arm64'

next unless config.name == 'Release'

# cocoapods defaults to not stripping the frameworks it creates
config.build_settings['STRIP_INSTALLED_PRODUCT'] = 'YES'
end

# Fix bundle targets' 'Signing Certificate' to 'Sign to Run Locally'
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,6 @@ SPEC CHECKSUMS:
XCGLogger: 1943831ef907df55108b0b18657953f868de973b
ZIPFoundation: 063163dc828bf699c5be160eb4f58f676322d94f

PODFILE CHECKSUM: 66c7e5daaace3b4e0564d0dc2b3d0bc3117f5973
PODFILE CHECKSUM: b93796cf4d894cdfad74a3b1d5c98991aaf1cd77

COCOAPODS: 1.11.3
8 changes: 7 additions & 1 deletion fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,13 @@ platform :ios do
provisioningProfiles: specifiers
}
)
emerge if ENV['EMERGE_API_TOKEN']
if ENV['EMERGE_API_TOKEN']
emerge(
repo_name: ENV.fetch('EMERGE_REPO_NAME', nil),
pr_number: ENV.fetch('EMERGE_PR_NUMBER', nil),
sha: ENV.fetch('EMERGE_SHA', nil)
)
end
ipa_path
end

Expand Down

0 comments on commit 58084e8

Please sign in to comment.