Skip to content

Commit c82c5db

Browse files
authored
Add Emerge integration (home-assistant#2233)
## Summary The nice folks at [Emerge](https://emergetools.com) have given us access to their platform for sizing the app and doing some non-live performance testing. This integrates it it. ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes Turning off Bitcode by switching to Xcode 14 is causing our binary size to bloat, and to investigate this best I'll fix this long-term by keeping track of size changes. This adds emerge to a few places: 1. Individual builds that are submitted to Apple 2. Pull requests The PR builds do not get sent to Apple nor are they uploaded because we do not want to allow in-development changes to go anywhere with our official signing information.
1 parent 95bafd4 commit c82c5db

File tree

6 files changed

+65
-2
lines changed

6 files changed

+65
-2
lines changed

.github/workflows/distribute.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
P12_VALUE_IOS_APP_STORE: ${{ secrets.P12_VALUE_IOS_APP_STORE }}
4848
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
4949
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
50+
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
5051
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
5152
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
5253
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs

.github/workflows/size.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Size build
2+
3+
on:
4+
pull_request:
5+
6+
env:
7+
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
8+
FASTLANE_SKIP_UPDATE_CHECK: true
9+
FASTLANE_XCODE_LIST_TIMEOUT: 60
10+
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
11+
HOMEBREW_NO_INSTALL_CLEANUP: TRUE
12+
BUNDLE_PATH: vendor/bundle
13+
14+
jobs:
15+
build:
16+
runs-on: macos-12
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Install Brews
21+
run: brew bundle
22+
23+
- name: Install Gems
24+
run: bundle install --jobs 4 --retry 3
25+
26+
- name: Install Pods
27+
run: bundle exec pod install --repo-update
28+
29+
- name: Build app
30+
run: |
31+
bundle exec fastlane ios size
32+
env:
33+
P12_KEY_IOS_APP_STORE: ${{ secrets.P12_KEY_IOS_APP_STORE }}
34+
P12_KEY_MAC_APP_STORE: ${{ secrets.P12_KEY_MAC_APP_STORE }}
35+
P12_KEY_MAC_DEVELOPER_ID: ${{ secrets.P12_KEY_MAC_DEVELOPER_ID }}
36+
P12_VALUE_IOS_APP_STORE: ${{ secrets.P12_VALUE_IOS_APP_STORE }}
37+
P12_VALUE_MAC_APP_STORE: ${{ secrets.P12_VALUE_MAC_APP_STORE }}
38+
P12_VALUE_MAC_DEVELOPER_ID: ${{ secrets.P12_VALUE_MAC_DEVELOPER_ID }}
39+
EMERGE_API_TOKEN: ${{ secrets.EMERGE_API_TOKEN }}
40+
# hard-coded so it doesn't cause 'ios' to be *** everywhere in the logs
41+
SENTRY_PROJECT: ios

Gemfile.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ GEM
164164
json
165165
mini_magick (>= 4.9.4, < 5.0.0)
166166
fastlane-plugin-clean_testflight_testers (0.3.0)
167+
fastlane-plugin-emerge (0.5.1)
168+
faraday (~> 1.1)
167169
ffi (1.15.5)
168170
fourflusher (2.3.1)
169171
fuzzy_match (2.0.4)
@@ -311,6 +313,7 @@ DEPENDENCIES
311313
fastlane
312314
fastlane-plugin-appicon
313315
fastlane-plugin-clean_testflight_testers
316+
fastlane-plugin-emerge
314317
rubocop
315318

316319
BUNDLED WITH

fastlane/Fastfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,9 +491,8 @@ private_lane :upload_binary_to_apple do |options|
491491
end
492492

493493
platform :ios do
494-
lane :build do
494+
private_lane :create_archive do
495495
setup_ha_ci if is_ci
496-
497496
specifiers = provisioning_profile_specifiers(sdk: 'iphoneos')
498497
ipa_path = build_ios_app(
499498
export_method: 'app-store',
@@ -506,11 +505,21 @@ platform :ios do
506505
provisioningProfiles: specifiers
507506
}
508507
)
508+
emerge if ENV['EMERGE_API_TOKEN']
509+
ipa_path
510+
end
511+
512+
lane :build do
513+
ipa_path = create_archive
509514
upload_binary_to_apple(
510515
type: 'ios',
511516
path: ipa_path
512517
)
513518
end
519+
520+
lane :size do
521+
create_archive
522+
end
514523
end
515524

516525
platform :mac do

fastlane/Pluginfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
gem 'fastlane-plugin-appicon'
66
gem 'fastlane-plugin-clean_testflight_testers'
7+
gem 'fastlane-plugin-emerge'

fastlane/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ Run tests
154154

155155

156156

157+
### ios size
158+
159+
```sh
160+
[bundle exec] fastlane ios size
161+
```
162+
163+
164+
157165
----
158166

159167

0 commit comments

Comments
 (0)