Skip to content

High performance self-hosted photo and video management solution.

chore: ios prod build with correct argument, get version number from pubspec (#23554)

Alexb8087b4fa23e
diff --git a/misc/release/pump-version.sh b/misc/release/pump-version.sh
index 65a2e70e50..d0db83b946 100755
--- a/misc/release/pump-version.sh
+++ b/misc/release/pump-version.sh
@@ -88,7 +88,6 @@ if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; then
fi
sed -i "s/\"android\.injected\.version\.name\" => \"$CURRENT_SERVER\",/\"android\.injected\.version\.name\" => \"$NEXT_SERVER\",/" mobile/android/fastlane/Fastfile
-sed -i "s/version_number: \"$CURRENT_SERVER\"$/version_number: \"$NEXT_SERVER\"/" mobile/ios/fastlane/Fastfile
sed -i "s/\"android\.injected\.version\.code\" => $CURRENT_MOBILE,/\"android\.injected\.version\.code\" => $NEXT_MOBILE,/" mobile/android/fastlane/Fastfile
sed -i "s/^version: $CURRENT_SERVER+$CURRENT_MOBILE$/version: $NEXT_SERVER+$NEXT_MOBILE/" mobile/pubspec.yaml
diff --git a/mobile/ios/fastlane/Fastfile b/mobile/ios/fastlane/Fastfile
index 8229c65534..c3dfea5f66 100644
--- a/mobile/ios/fastlane/Fastfile
+++ b/mobile/ios/fastlane/Fastfile
@@ -32,6 +32,17 @@ platform :ios do
)
end
+ # Helper method to get version from pubspec.yaml
+def get_version_from_pubspec
+ require 'yaml'
+
+ pubspec_path = File.join(Dir.pwd, "../..", "pubspec.yaml")
+ pubspec = YAML.load_file(pubspec_path)
+
+ version_string = pubspec['version']
+ version_string ? version_string.split('+').first : nil
+end
+
# Helper method to configure code signing for all targets
def configure_code_signing(bundle_id_suffix: "")
bundle_suffix = bundle_id_suffix.empty? ? "" : ".#{bundle_id_suffix}"
@@ -158,7 +169,8 @@ platform :ios do
# Build and upload with version number
build_and_upload(
api_key: api_key,
- version_number: "2.1.0"
+ version_number: get_version_from_pubspec,
+ distribute_external: false,
)
end
@@ -168,8 +180,9 @@ platform :ios do
path: "./Runner.xcodeproj",
targets: ["Runner", "ShareExtension", "WidgetExtension"]
)
+
increment_version_number(
- version_number: "2.2.2"
+ version_number: get_version_from_pubspec
)
increment_build_number(
build_number: latest_testflight_build_number + 1,