|
@@ -23,11 +23,38 @@ DEVICE_NAME = ENV["DEVICE_NAME"]
|
|
|
DEVICE_ID = ENV["DEVICE_ID"]
|
|
DEVICE_ID = ENV["DEVICE_ID"]
|
|
|
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
|
|
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+# Define method to parse xcconfig file, and replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
|
|
|
|
|
+def parse_xcconfig_file(path)
|
|
|
|
|
+ xcconfig = {}
|
|
|
|
|
+ File.open(path).each_line do |line|
|
|
|
|
|
+ line.strip!
|
|
|
|
|
+ next if line.empty? || line.start_with?('//')
|
|
|
|
|
+ parts = line.split('=')
|
|
|
|
|
+ next if parts.length < 2 # Skip lines without '='
|
|
|
|
|
+ key, value = parts.map(&:strip)
|
|
|
|
|
+ # Replace $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
|
|
|
|
|
+ value = value.gsub('$(DEVELOPMENT_TEAM)', TEAMID)
|
|
|
|
|
+ xcconfig[key] = value
|
|
|
|
|
+ end
|
|
|
|
|
+ xcconfig
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+# Path to config.xcconfig file
|
|
|
|
|
+xcconfig_path = "#{GITHUB_WORKSPACE}/Config.xcconfig"
|
|
|
|
|
+
|
|
|
|
|
+# Load the variables from config.xcconfig
|
|
|
|
|
+xcconfig = parse_xcconfig_file(xcconfig_path)
|
|
|
|
|
+
|
|
|
|
|
+# Access BUNDLE_IDENTIFIER from the xcconfig file after replacing $(DEVELOPMENT_TEAM) with ENV["TEAMID"]
|
|
|
|
|
+ENV["BUNDLE_ID"] = xcconfig["BUNDLE_IDENTIFIER"]
|
|
|
|
|
+
|
|
|
platform :ios do
|
|
platform :ios do
|
|
|
desc "Build iAPS"
|
|
desc "Build iAPS"
|
|
|
lane :build_iAPS do
|
|
lane :build_iAPS do
|
|
|
setup_ci if ENV['CI']
|
|
setup_ci if ENV['CI']
|
|
|
-
|
|
|
|
|
|
|
+ BUNDLE_ID = ENV["BUNDLE_ID"]
|
|
|
|
|
+
|
|
|
update_project_team(
|
|
update_project_team(
|
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
|
teamid: "#{TEAMID}"
|
|
teamid: "#{TEAMID}"
|
|
@@ -40,7 +67,7 @@ platform :ios do
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
previous_build_number = latest_testflight_build_number(
|
|
previous_build_number = latest_testflight_build_number(
|
|
|
- app_identifier: "ru.artpancreas.#{TEAMID}.FreeAPS",
|
|
|
|
|
|
|
+ app_identifier: "#{BUNDLE_ID}",
|
|
|
api_key: api_key,
|
|
api_key: api_key,
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -55,14 +82,14 @@ platform :ios do
|
|
|
type: "appstore",
|
|
type: "appstore",
|
|
|
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
|
|
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
|
|
|
app_identifier: [
|
|
app_identifier: [
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS",
|
|
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp",
|
|
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp.watchkitextension"
|
|
|
|
|
|
|
+ "#{BUNDLE_ID}",
|
|
|
|
|
+ "#{BUNDLE_ID}.watchkitapp",
|
|
|
|
|
+ "#{BUNDLE_ID}.watchkitapp.watchkitextension"
|
|
|
]
|
|
]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
previous_build_number = latest_testflight_build_number(
|
|
previous_build_number = latest_testflight_build_number(
|
|
|
- app_identifier: "ru.artpancreas.#{TEAMID}.FreeAPS",
|
|
|
|
|
|
|
+ app_identifier: "#{BUNDLE_ID}",
|
|
|
api_key: api_key,
|
|
api_key: api_key,
|
|
|
)
|
|
)
|
|
|
|
|
|
|
@@ -79,21 +106,21 @@ platform :ios do
|
|
|
|
|
|
|
|
update_code_signing_settings(
|
|
update_code_signing_settings(
|
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
|
- profile_name: mapping["ru.artpancreas.#{TEAMID}.FreeAPS"],
|
|
|
|
|
|
|
+ profile_name: mapping["#{BUNDLE_ID}"],
|
|
|
code_sign_identity: "iPhone Distribution",
|
|
code_sign_identity: "iPhone Distribution",
|
|
|
targets: ["FreeAPS"]
|
|
targets: ["FreeAPS"]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
update_code_signing_settings(
|
|
update_code_signing_settings(
|
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
|
- profile_name: mapping["ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp.watchkitextension"],
|
|
|
|
|
|
|
+ profile_name: mapping["#{BUNDLE_ID}.watchkitapp.watchkitextension"],
|
|
|
code_sign_identity: "iPhone Distribution",
|
|
code_sign_identity: "iPhone Distribution",
|
|
|
targets: ["FreeAPSWatch WatchKit Extension"]
|
|
targets: ["FreeAPSWatch WatchKit Extension"]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
update_code_signing_settings(
|
|
update_code_signing_settings(
|
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj",
|
|
|
- profile_name: mapping["ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp"],
|
|
|
|
|
|
|
+ profile_name: mapping["#{BUNDLE_ID}.watchkitapp"],
|
|
|
code_sign_identity: "iPhone Distribution",
|
|
code_sign_identity: "iPhone Distribution",
|
|
|
targets: ["FreeAPSWatch"]
|
|
targets: ["FreeAPSWatch"]
|
|
|
)
|
|
)
|
|
@@ -133,6 +160,7 @@ platform :ios do
|
|
|
lane :identifiers do
|
|
lane :identifiers do
|
|
|
setup_ci if ENV['CI']
|
|
setup_ci if ENV['CI']
|
|
|
ENV["MATCH_READONLY"] = false.to_s
|
|
ENV["MATCH_READONLY"] = false.to_s
|
|
|
|
|
+ BUNDLE_ID = ENV["BUNDLE_ID"]
|
|
|
|
|
|
|
|
app_store_connect_api_key(
|
|
app_store_connect_api_key(
|
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
@@ -147,18 +175,18 @@ platform :ios do
|
|
|
}
|
|
}
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- configure_bundle_id("FreeAPS", "ru.artpancreas.#{TEAMID}.FreeAPS", [
|
|
|
|
|
|
|
+ configure_bundle_id("FreeAPS", "#{BUNDLE_ID}", [
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS,
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS,
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT,
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT,
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::NFC_TAG_READING
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::NFC_TAG_READING
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
- configure_bundle_id("FreeAPSWatch WatchKit Extension", "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp.watchkitextension", [
|
|
|
|
|
|
|
+ configure_bundle_id("FreeAPSWatch WatchKit Extension", "#{BUNDLE_ID}.watchkitapp.watchkitextension", [
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS,
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS,
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
- configure_bundle_id("FreeAPSWatch", "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp", [
|
|
|
|
|
|
|
+ configure_bundle_id("FreeAPSWatch", "#{BUNDLE_ID}.watchkitapp", [
|
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS
|
|
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS
|
|
|
])
|
|
])
|
|
|
|
|
|
|
@@ -168,6 +196,7 @@ platform :ios do
|
|
|
lane :certs do
|
|
lane :certs do
|
|
|
setup_ci if ENV['CI']
|
|
setup_ci if ENV['CI']
|
|
|
ENV["MATCH_READONLY"] = false.to_s
|
|
ENV["MATCH_READONLY"] = false.to_s
|
|
|
|
|
+ BUNDLE_ID = ENV["BUNDLE_ID"]
|
|
|
|
|
|
|
|
app_store_connect_api_key(
|
|
app_store_connect_api_key(
|
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
@@ -180,9 +209,9 @@ platform :ios do
|
|
|
force: true,
|
|
force: true,
|
|
|
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
|
|
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
|
|
|
app_identifier: [
|
|
app_identifier: [
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS",
|
|
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp.watchkitextension",
|
|
|
|
|
- "ru.artpancreas.#{TEAMID}.FreeAPS.watchkitapp",
|
|
|
|
|
|
|
+ "#{BUNDLE_ID}",
|
|
|
|
|
+ "#{BUNDLE_ID}.watchkitapp.watchkitextension",
|
|
|
|
|
+ "#{BUNDLE_ID}.watchkitapp",
|
|
|
]
|
|
]
|
|
|
)
|
|
)
|
|
|
end
|
|
end
|
|
@@ -191,6 +220,7 @@ platform :ios do
|
|
|
lane :validate_secrets do
|
|
lane :validate_secrets do
|
|
|
setup_ci if ENV['CI']
|
|
setup_ci if ENV['CI']
|
|
|
ENV["MATCH_READONLY"] = true.to_s
|
|
ENV["MATCH_READONLY"] = true.to_s
|
|
|
|
|
+ BUNDLE_ID = ENV["BUNDLE_ID"]
|
|
|
|
|
|
|
|
app_store_connect_api_key(
|
|
app_store_connect_api_key(
|
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
key_id: "#{FASTLANE_KEY_ID}",
|
|
@@ -202,7 +232,7 @@ platform :ios do
|
|
|
bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier)
|
|
bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
- find_bundle_id("ru.artpancreas.#{TEAMID}.FreeAPS")
|
|
|
|
|
|
|
+ find_bundle_id("#{BUNDLE_ID}")
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
desc "Nuke Certs"
|
|
desc "Nuke Certs"
|