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