From 864dc66e8ece8aa4001005d6a1f97de7145a73b6 Mon Sep 17 00:00:00 2001 From: "Developer @ Loverde Company" Date: Fri, 11 Sep 2026 14:03:47 -0300 Subject: [PATCH] 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. --- .gitea/workflows/beta.yml | 3 --- fastlane/Fastfile | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/beta.yml b/.gitea/workflows/beta.yml index 5f52542..89cee88 100644 --- a/.gitea/workflows/beta.yml +++ b/.gitea/workflows/beta.yml @@ -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: | diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 183bbfe..a76df60 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -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",