fix: stop overriding CURRENT_PROJECT_VERSION with the CI run number

assemble was passing CURRENT_PROJECT_VERSION=$BUILD_NUMBER (github.run_
number-style CI counter) as an xcarg, silently replacing the project's
real, manually-managed version (e.g. '2026.09.11.0.0.1') with an
unrelated small integer - the just-uploaded TestFlight build showed up
as '0.0.1 (51)' instead of the intended version. Removed the override
and the now-unused BUILD_NUMBER env var in beta.yml; CI now always
builds with whatever CURRENT_PROJECT_VERSION is committed in the
project. Re-running CI against the same commit without bumping it first
will now get a clear 'duplicate build number' rejection from Apple
instead of silently uploading under the wrong version.
This commit is contained in:
2026-09-11 14:03:47 -03:00
parent f973926aa4
commit 864dc66e8e
2 changed files with 13 additions and 6 deletions

View File

@@ -9,9 +9,6 @@ jobs:
build-and-upload:
runs-on: macos-build
env:
BUILD_NUMBER: ${{ github.run_number }}
steps:
- name: Checkout repository (workaround - Gitea git-upload-pack bug, see go-gitea/gitea#21819)
run: |

View File

@@ -16,10 +16,20 @@ lane :assemble do |options|
# Manual signing (team/identity/profile) for the "PediFoods" target is
# baked directly into PediFoods.xcodeproj's own project settings - not
# overridden here.
# agvtool needs VERSIONING_SYSTEM = apple-generic, which this project doesn't
# set, so it silently no-ops - pass CURRENT_PROJECT_VERSION directly instead.
#
# CURRENT_PROJECT_VERSION is likewise never overridden here - it's
# whatever is committed in the project (manually bumped, e.g.
# "2026.09.11.0.0.1"). A prior version of this lane overrode it with
# the CI job's own run number (BUILD_NUMBER = github.run_number-style
# counter) to guarantee a unique, ever-increasing build number per
# run - but that silently replaced the real, meaningful version with
# an unrelated small integer (a build uploaded as "51" instead of the
# intended "2026.09.11.0.0.1"). Trusting the committed value means
# re-running CI against the same commit without bumping
# CURRENT_PROJECT_VERSION first will make TestFlight/App Store reject
# the upload as a duplicate build number - a clear, safe failure,
# which is the correct behavior for a manually-versioned project.
xcargs = "-skipPackagePluginValidation -skipMacroValidation"
xcargs += " CURRENT_PROJECT_VERSION=#{ENV['BUILD_NUMBER']}" if ENV["BUILD_NUMBER"]
build_app(
scheme: "PediFoods",