Bake Home Assistant token into release builds
Some checks failed
TestFlight / Build and upload (push) Failing after 25s
Some checks failed
TestFlight / Build and upload (push) Failing after 25s
This commit is contained in:
@@ -14,11 +14,17 @@ platform :ios do
|
||||
build_number = ENV.fetch("GITHUB_RUN_NUMBER")
|
||||
UI.user_error!("GITHUB_RUN_NUMBER must be a positive integer") unless build_number.match?(/\A[1-9]\d*\z/)
|
||||
|
||||
home_assistant_access_token = ENV["HOME_ASSISTANT_ACCESS_TOKEN"]&.strip
|
||||
if home_assistant_access_token.to_s.empty?
|
||||
UI.user_error!("HOME_ASSISTANT_ACCESS_TOKEN must be configured for release builds")
|
||||
end
|
||||
|
||||
update_info_plist(
|
||||
plist_path: "XIONControlPanel/SupportingFiles/Info.plist",
|
||||
block: proc do |plist|
|
||||
plist["CFBundleShortVersionString"] = version
|
||||
plist["CFBundleVersion"] = build_number
|
||||
plist["HomeAssistantAccessToken"] = home_assistant_access_token
|
||||
end
|
||||
)
|
||||
|
||||
@@ -31,6 +37,21 @@ platform :ios do
|
||||
|
||||
build_app(scheme: "XIONControlPanel")
|
||||
|
||||
archived_plist = File.join(
|
||||
lane_context[SharedValues::XCODEBUILD_ARCHIVE],
|
||||
"Products",
|
||||
"Applications",
|
||||
"XION.app",
|
||||
"Info.plist"
|
||||
)
|
||||
archived_access_token = get_info_plist_value(
|
||||
path: archived_plist,
|
||||
key: "HomeAssistantAccessToken"
|
||||
).to_s
|
||||
unless archived_access_token == home_assistant_access_token
|
||||
UI.user_error!("The archived app does not contain the configured Home Assistant access token")
|
||||
end
|
||||
|
||||
upload_to_testflight(
|
||||
api_key: api_key,
|
||||
skip_waiting_for_build_processing: true,
|
||||
|
||||
Reference in New Issue
Block a user