From 4dd46b1cf6c34788377fae76babe34a51fb222d4 Mon Sep 17 00:00:00 2001 From: senseiGai Date: Mon, 9 Mar 2026 19:34:29 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20Fastlane:=20=D0=B0=D0=B2=D1=82=D0=BE=D0=B8=D0=BD?= =?UTF-8?q?=D0=BA=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=20=D0=B2=D0=B5=D1=80?= =?UTF-8?q?=D1=81=D0=B8=D0=B9,=20=D0=B8=D0=B4=D0=B5=D0=BD=D1=82=D0=B8?= =?UTF-8?q?=D1=84=D0=B8=D0=BA=D0=B0=D1=82=D0=BE=D1=80=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=20=D1=8D?= =?UTF-8?q?=D0=BA=D1=81=D0=BF=D0=BE=D1=80=D1=82=D0=BD=D1=8B=D0=B9=20compli?= =?UTF-8?q?ance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- Info.plist | 5 +- Rosetta.xcodeproj/project.pbxproj | 8 +-- fastlane/Appfile | 2 +- fastlane/Fastfile | 91 +++++++++++++++++++++---------- fastlane/README.md | 2 +- 6 files changed, 73 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index a736679..58ae931 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,4 @@ fastlane/test_output # macOS .DS_Store *.swp -*~ +*~ \ No newline at end of file diff --git a/Info.plist b/Info.plist index 0c67376..85f0971 100644 --- a/Info.plist +++ b/Info.plist @@ -1,5 +1,8 @@ - + + ITSAppUsesNonExemptEncryption + + diff --git a/Rosetta.xcodeproj/project.pbxproj b/Rosetta.xcodeproj/project.pbxproj index eb7b9ac..51a165a 100644 --- a/Rosetta.xcodeproj/project.pbxproj +++ b/Rosetta.xcodeproj/project.pbxproj @@ -264,7 +264,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = QN8Z263QGX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -280,7 +280,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -302,7 +302,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 7; DEVELOPMENT_TEAM = QN8Z263QGX; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -318,7 +318,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.3; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = com.rosetta.dev; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/fastlane/Appfile b/fastlane/Appfile index d8b57e6..323c509 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,4 +1,4 @@ -app_identifier("com.rosetta.messenger") +app_identifier("com.rosetta.dev") apple_id("melissa.james2000@aol.com") # team_id и itc_team_id не нужны для индивидуального аккаунта — Fastlane определит автоматически diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 062acd1..3207db4 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -2,39 +2,76 @@ default_platform(:ios) platform :ios do + # ─── Хелпер: читает MARKETING_VERSION из pbxproj ─── + def current_marketing_version + pbxproj = File.read("../Rosetta.xcodeproj/project.pbxproj") + pbxproj.match(/MARKETING_VERSION = ([\d.]+);/)[1] + end + + # ─── Хелпер: читает CURRENT_PROJECT_VERSION из pbxproj ─── + def current_build_number + pbxproj = File.read("../Rosetta.xcodeproj/project.pbxproj") + pbxproj.match(/CURRENT_PROJECT_VERSION = (\d+);/)[1].to_i + end + + # ─── Хелпер: инкремент patch версии (1.0.4 → 1.0.5) ─── + def bump_patch(version) + parts = version.split(".").map(&:to_i) + parts[2] = (parts[2] || 0) + 1 + parts.join(".") + end + + # ─── Хелпер: обновляет MARKETING_VERSION в pbxproj ─── + def set_marketing_version(new_version) + path = "../Rosetta.xcodeproj/project.pbxproj" + content = File.read(path) + content.gsub!(/MARKETING_VERSION = [\d.]+;/, "MARKETING_VERSION = #{new_version};") + File.write(path, content) + UI.success("MARKETING_VERSION → #{new_version}") + end + + # ─── Хелпер: обновляет CURRENT_PROJECT_VERSION в pbxproj ─── + def set_build_number(new_build) + path = "../Rosetta.xcodeproj/project.pbxproj" + content = File.read(path) + content.gsub!(/CURRENT_PROJECT_VERSION = \d+;/, "CURRENT_PROJECT_VERSION = #{new_build};") + File.write(path, content) + UI.success("CURRENT_PROJECT_VERSION → #{new_build}") + end + # ─── Автоинкремент build number ─── desc "Increment build number (CURRENT_PROJECT_VERSION)" lane :bump_build do - increment_build_number( - xcodeproj: "Rosetta.xcodeproj" - ) + new_build = current_build_number + 1 + set_build_number(new_build) end - # ─── Инкремент версии (patch/minor/major) ─── - desc "Increment version number. Usage: fastlane bump_version type:patch" - lane :bump_version do |options| - type = options[:type] || "patch" - increment_version_number( - xcodeproj: "Rosetta.xcodeproj", - bump_type: type - ) + # ─── Инкремент версии (patch) ─── + desc "Increment version number (patch)" + lane :bump_version do + new_version = bump_patch(current_marketing_version) + set_marketing_version(new_version) end # ─── Билд для TestFlight ─── desc "Build and upload to TestFlight" lane :beta do - increment_build_number( - xcodeproj: "Rosetta.xcodeproj" - ) - build_app( project: "Rosetta.xcodeproj", scheme: "Rosetta", configuration: "Release", export_method: "app-store", - clean: true + clean: true, + xcargs: "SWIFT_OPTIMIZATION_LEVEL='-Onone'" ) + # Инкремент только после успешной сборки + new_version = bump_patch(current_marketing_version) + set_marketing_version(new_version) + + new_build = current_build_number + 1 + set_build_number(new_build) + upload_to_testflight( skip_waiting_for_build_processing: true ) @@ -42,26 +79,22 @@ platform :ios do # ─── Release в App Store ─── desc "Build and upload to App Store" - lane :release do |options| - type = options[:type] || "patch" - - increment_version_number( - xcodeproj: "Rosetta.xcodeproj", - bump_type: type - ) - - increment_build_number( - xcodeproj: "Rosetta.xcodeproj" - ) - + lane :release do build_app( project: "Rosetta.xcodeproj", scheme: "Rosetta", configuration: "Release", export_method: "app-store", - clean: true + clean: true, + xcargs: "SWIFT_OPTIMIZATION_LEVEL='-Onone'" ) + new_version = bump_patch(current_marketing_version) + set_marketing_version(new_version) + + new_build = current_build_number + 1 + set_build_number(new_build) + upload_to_app_store( force: true, skip_screenshots: true diff --git a/fastlane/README.md b/fastlane/README.md index 0c0f728..d6fc128 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -29,7 +29,7 @@ Increment build number (CURRENT_PROJECT_VERSION) [bundle exec] fastlane ios bump_version ``` -Increment version number. Usage: fastlane bump_version type:patch +Increment version number (patch) ### ios beta