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

Strip Cocoapods frameworks on build #2234

Merged
merged 6 commits into from Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/distribute.yml
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
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
@@ -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
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
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
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
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