From 1ad0fe23fcbfc9f122fe7fc2e56f90a228bf02cd Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Wed, 25 Feb 2026 00:04:42 +0530 Subject: [PATCH] ci: fix - version number was inconsistent across deployment of beta channels --- .github/workflows/alpha.yml | 7 +++---- .github/workflows/nightly.yml | 7 +++---- .github/workflows/pr.yml | 6 +++--- scripts/ci/workflow.py | 14 +++++++------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 5ba3efb9..76cc8fe5 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -50,17 +50,16 @@ jobs: MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version) SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id) - QUALIFIED_VERSION=$(python3 scripts/ci/workflow.py compute-qualified \ + NORMALIZED_VERSION=$(python3 scripts/ci/workflow.py compute-normalized \ "$MARKETING_VERSION" \ "$BUILD_NUM" \ - "${{ env.CHANNEL }}" \ "$SHORT_COMMIT") - python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION" + python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION" echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV - echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV + echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8c4be197..89dc7263 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -74,17 +74,16 @@ jobs: MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version) SHORT_COMMIT=$(python3 scripts/ci/workflow.py commit-id) - QUALIFIED_VERSION=$(python3 scripts/ci/workflow.py compute-qualified \ + NORMALIZED_VERSION=$(python3 scripts/ci/workflow.py compute-normalized \ "$MARKETING_VERSION" \ "$BUILD_NUM" \ - "${{ env.CHANNEL }}" \ "$SHORT_COMMIT") - python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION" + python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION" echo "BUILD_NUM=$BUILD_NUM" | tee -a $GITHUB_ENV echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV - echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV + echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV - name: Setup Xcode if: steps.build_gate.outputs.should_skip != 'true' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 22d96e63..931084a1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -27,10 +27,10 @@ jobs: run: | MARKETING_VERSION=$(python3 scripts/ci/workflow.py get-marketing-version) SHORT_COMMIT=$(git rev-parse --short ${{ github.event.pull_request.head.sha }}) - QUALIFIED_VERSION="${MARKETING_VERSION}-pr.${{ github.event.pull_request.number }}+${SHORT_COMMIT}" - python3 scripts/ci/workflow.py set-marketing-version "$QUALIFIED_VERSION" + NORMALIZED_VERSION="${MARKETING_VERSION}-pr.${{ github.event.pull_request.number }}+${SHORT_COMMIT}" + python3 scripts/ci/workflow.py set-marketing-version "$NORMALIZED_VERSION" echo "SHORT_COMMIT=$SHORT_COMMIT" | tee -a $GITHUB_ENV - echo "MARKETING_VERSION=$QUALIFIED_VERSION" | tee -a $GITHUB_ENV + echo "MARKETING_VERSION=$NORMALIZED_VERSION" | tee -a $GITHUB_ENV - name: Setup Xcode uses: maxim-lobanov/setup-xcode@v1.6.0 diff --git a/scripts/ci/workflow.py b/scripts/ci/workflow.py index 78874d50..1881af9e 100644 --- a/scripts/ci/workflow.py +++ b/scripts/ci/workflow.py @@ -181,9 +181,12 @@ def set_marketing_version(qualified): f"{ROOT}/Build.xcconfig" ) -def compute_qualified_version(marketing, build_num, channel, short): - date = datetime.datetime.now(datetime.UTC).strftime("%Y.%m.%d") - return f"{marketing}-{channel}.{date}.{build_num}+{short}" + +def compute_qualified_version(marketing, build_num, short): + now = datetime.datetime.now(datetime.UTC) + date = now.strftime("%Y%m%d") # normalized date + base = marketing.strip() + return f"{base}-{date}.{build_num}+{short}" # ---------------------------------------------------------- # CLEAN @@ -420,7 +423,6 @@ def upload_release(release_name, release_tag, commit_sha, repo, upstream_tag_rec meta = json.loads(metadata_path.read_text()) marketing_version = meta.get("version_ipa") - is_beta = bool(meta.get("is_beta")) build_datetime = meta.get("version_date") dt = datetime.datetime.fromisoformat( @@ -461,8 +463,6 @@ def upload_release(release_name, release_tag, commit_sha, repo, upstream_tag_rec body_file = ROOT / "release_body.md" body_file.write_text(body, encoding="utf-8") - prerelease_flag = "--prerelease" if is_beta else "" - draft_flag = "--draft" if draft else "" prerelease_flag = "--prerelease" if prerelease else "" latest_flag = "" if update_tag else "--latest=false" @@ -517,7 +517,7 @@ COMMANDS = { # ---------------------------------------------------------- "get-marketing-version" : (get_marketing_version, 0, ""), "set-marketing-version" : (set_marketing_version, 1, ""), - "compute-qualified" : (compute_qualified_version, 4, " "), + "compute-qualified" : (compute_qualified_version, 3, " "), "reserve_build_number" : (reserve_build_number, 1, ""), "get-product-name" : (get_product_name, 0, ""), "get-bundle-id" : (get_bundle_id, 0, ""),