Skip to content

Commit b8087b4

Browse files
alextran1502bo0tzz
andauthored
chore: ios prod build with correct argument, get version number from pubspec (immich-app#23554)
* chore: ios prod build with correct argument, get version number from pubspec * Update mobile/ios/fastlane/Fastfile Co-authored-by: bo0tzz <git@bo0tzz.me> --------- Co-authored-by: bo0tzz <git@bo0tzz.me>
1 parent d94cb96 commit b8087b4

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

misc/release/pump-version.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ if [ "$CURRENT_MOBILE" != "$NEXT_MOBILE" ]; then
8888
fi
8989

9090
sed -i "s/\"android\.injected\.version\.name\" => \"$CURRENT_SERVER\",/\"android\.injected\.version\.name\" => \"$NEXT_SERVER\",/" mobile/android/fastlane/Fastfile
91-
sed -i "s/version_number: \"$CURRENT_SERVER\"$/version_number: \"$NEXT_SERVER\"/" mobile/ios/fastlane/Fastfile
9291
sed -i "s/\"android\.injected\.version\.code\" => $CURRENT_MOBILE,/\"android\.injected\.version\.code\" => $NEXT_MOBILE,/" mobile/android/fastlane/Fastfile
9392
sed -i "s/^version: $CURRENT_SERVER+$CURRENT_MOBILE$/version: $NEXT_SERVER+$NEXT_MOBILE/" mobile/pubspec.yaml
9493

mobile/ios/fastlane/Fastfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ platform :ios do
3232
)
3333
end
3434

35+
# Helper method to get version from pubspec.yaml
36+
def get_version_from_pubspec
37+
require 'yaml'
38+
39+
pubspec_path = File.join(Dir.pwd, "../..", "pubspec.yaml")
40+
pubspec = YAML.load_file(pubspec_path)
41+
42+
version_string = pubspec['version']
43+
version_string ? version_string.split('+').first : nil
44+
end
45+
3546
# Helper method to configure code signing for all targets
3647
def configure_code_signing(bundle_id_suffix: "")
3748
bundle_suffix = bundle_id_suffix.empty? ? "" : ".#{bundle_id_suffix}"
@@ -158,7 +169,8 @@ platform :ios do
158169
# Build and upload with version number
159170
build_and_upload(
160171
api_key: api_key,
161-
version_number: "2.1.0"
172+
version_number: get_version_from_pubspec,
173+
distribute_external: false,
162174
)
163175
end
164176

@@ -168,8 +180,9 @@ platform :ios do
168180
path: "./Runner.xcodeproj",
169181
targets: ["Runner", "ShareExtension", "WidgetExtension"]
170182
)
183+
171184
increment_version_number(
172-
version_number: "2.2.2"
185+
version_number: get_version_from_pubspec
173186
)
174187
increment_build_number(
175188
build_number: latest_testflight_build_number + 1,

0 commit comments

Comments
 (0)