Skip to content

armgit / sure

Public Imported from GitHub
0

The personal finance app for everyone (by everyone)

Ruby

Use a development placeholder for the mobile app version (#4721)

Sure Admin (bot)6bcb6268d39a
diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml
index 46d7ec1444..8a21f29419 100644
--- a/.github/workflows/flutter-build.yml
+++ b/.github/workflows/flutter-build.yml
@@ -219,7 +219,8 @@ jobs:
- name: Build iOS (No Code Signing)
working-directory: mobile
- run: flutter build ios --release --no-codesign --build-name="$SURE_BUILD_NAME"
+ # Unsigned validation artifact, not a store upload; do not inherit the +0 placeholder.
+ run: flutter build ios --release --no-codesign --build-name="$SURE_BUILD_NAME" --build-number=1
- name: Create IPA archive info
working-directory: mobile
diff --git a/mobile/README.md b/mobile/README.md
index 7c93708ac5..74c58882f1 100644
--- a/mobile/README.md
+++ b/mobile/README.md
@@ -212,7 +212,17 @@ older bundles after newer ones or reuse a code already accepted by Google Play.
The allocator rejects codes at or below the legacy `20260402` baseline or above
Google Play's `2100000000` limit (reached in 2086). It does not query Play Console:
any independently uploaded higher code must be accounted for before switching.
-Local builds retain the pubspec fallback. iOS/TestFlight numbering is unchanged.
+The checked-in `version: 0.0.0-dev+0` is a development placeholder, not a
+publishable version. Android CI always replaces its build number. Unsigned iOS
+CI strips `-dev` from the marketing version and explicitly uses build number `1`;
+signed TestFlight builds continue to supply their existing timestamp build number.
+
+For local native builds, supply a positive build number (for example,
+`flutter build apk --debug --build-number=1`). For iOS, also supply a numeric name:
+`flutter build ios --no-codesign --build-name=0.0.0 --build-number=1`.
+A lower Android code cannot upgrade an installed higher-code app: uninstall the
+existing app or explicitly use a higher code. Direct native packaging of the raw
+`0.0.0-dev+0` placeholder is not a supported distribution path.
## License
diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml
index c793858e51..d25f3aec67 100644
--- a/mobile/pubspec.yaml
+++ b/mobile/pubspec.yaml
@@ -1,8 +1,8 @@
name: sure_mobile
description: A mobile app for Sure personal finance management
publish_to: 'none'
-# Local fallback only. Release CI overrides the name and Android build number.
-version: 0.6.9+20260402
+# Development placeholder only. CI supplies platform-specific versions/build numbers.
+version: 0.0.0-dev+0
environment:
sdk: '>=3.3.0 <4.0.0'
diff --git a/test/workflows/mobile_release_workflow_test.rb b/test/workflows/mobile_release_workflow_test.rb
index c497917552..93d945ca85 100644
--- a/test/workflows/mobile_release_workflow_test.rb
+++ b/test/workflows/mobile_release_workflow_test.rb
@@ -39,8 +39,9 @@ class MobileReleaseWorkflowTest < ActiveSupport::TestCase
[ [ "flutter-build", "build-android" ], [ "flutter-build", "build-ios" ],
[ "ios-testflight", "build-and-upload" ] ].each do |file, job|
result = resolve(file, job, ref: "main")
- assert_equal "0.6.9\n", result[:metadata]
- assert_includes result[:output], "=0.6.9\n"
+ assert_equal "0.0.0-dev\n", result[:metadata]
+ name = job == "build-android" ? "0.0.0-dev" : "0.0.0"
+ assert_includes result[:output], "=#{name}\n"
end
end
@@ -123,6 +124,20 @@ class MobileReleaseWorkflowTest < ActiveSupport::TestCase
end
end
+ test "unsigned iOS packaging overrides the development build number" do
+ Dir.mktmpdir do |dir|
+ File.write(File.join(dir, "flutter"), "#!/bin/bash\nprintf '%s\\n' \"$*\"\n")
+ FileUtils.chmod(0755, File.join(dir, "flutter"))
+ script = workflow("flutter-build").fetch("jobs").fetch("build-ios").fetch("steps")
+ .find { |step| step["name"] == "Build iOS (No Code Signing)" }.fetch("run")
+ %w[0.0.0 2026.11.4].each do |name|
+ output, status = Open3.capture2e({ "PATH" => "#{dir}:#{ENV.fetch('PATH')}", "SURE_BUILD_NAME" => name }, "bash", "-e", "-c", script)
+ assert status.success?, output
+ assert_equal "build ios --release --no-codesign --build-name=#{name} --build-number=1\n", output
+ end
+ end
+ end
+
private
def android_number(timestamp)
Dir.mktmpdir do |dir|
@@ -144,7 +159,7 @@ class MobileReleaseWorkflowTest < ActiveSupport::TestCase
def execute(file, job, step_name, env)
Dir.mktmpdir do |dir|
FileUtils.mkdir_p(File.join(dir, "mobile"))
- File.write(File.join(dir, "mobile/pubspec.yaml"), "version: 0.6.9+42\n")
+ FileUtils.cp(Rails.root.join("mobile/pubspec.yaml"), File.join(dir, "mobile/pubspec.yaml"))
output_path = File.join(dir, "output")
env = env.merge("GITHUB_ENV" => output_path, "GITHUB_OUTPUT" => output_path)
script = workflow(file).fetch("jobs").fetch(job).fetch("steps").find { |step| step["name"] == step_name }.fetch("run")