From b98c76e72a869b6a677292e24a892190436764dd Mon Sep 17 00:00:00 2001 From: dab246 Date: Tue, 21 Apr 2026 13:18:36 +0700 Subject: [PATCH] TF-4269 Fix Sentry release version: keep full version including -rc suffix Use full pubspec version (e.g. 0.28.3-rc08) as SENTRY_RELEASE for both Android and iOS, matching the version the app reports at runtime. Validation still compares base versions only (strips -rc suffix) to allow rc tags to match the base version in pubspec. --- .github/workflows/release.yaml | 28 ++++++++++++++----------- lib/main/utils/ios_sharing_manager.dart | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 179323644..405ec6c17 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -101,13 +101,14 @@ jobs: # 1. Install Sentry CLI curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION="2.42.2" bash - # 2. Validate tag version matches pubspec.yaml version (base version only, ignoring -rc* suffix) - TAG_VERSION="${GITHUB_REF_NAME#v}" - TAG_VERSION="${TAG_VERSION%%-rc*}" + # 2. Validate tag base version matches pubspec.yaml base version (ignoring -rc* suffix). + # SENTRY_RELEASE uses the full pubspec version (including -rc* suffix) to match what the app reports. + TAG_BASE="${GITHUB_REF_NAME#v}" + TAG_BASE="${TAG_BASE%%-rc*}" PUBSPEC_VERSION=$(awk '/^version:/{split($2,a,"+"); print a[1]; exit}' pubspec.yaml) - PUBSPEC_VERSION="${PUBSPEC_VERSION%%-rc*}" - if [ "$PUBSPEC_VERSION" != "$TAG_VERSION" ]; then - echo "::error::Tag version ($TAG_VERSION) does not match pubspec version ($PUBSPEC_VERSION)." + PUBSPEC_BASE="${PUBSPEC_VERSION%%-rc*}" + if [ "$PUBSPEC_BASE" != "$TAG_BASE" ]; then + echo "::error::Tag version ($TAG_BASE) does not match pubspec version ($PUBSPEC_BASE)." exit 1 fi SENTRY_RELEASE="$PUBSPEC_VERSION" @@ -152,15 +153,18 @@ jobs: # 1. Install Sentry CLI curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION="2.42.2" bash - # 2. Validate tag version matches pubspec.yaml version (base version only, ignoring -rc* suffix) - TAG_VERSION="${GITHUB_REF_NAME#v}" - TAG_VERSION="${TAG_VERSION%%-rc*}" + # 2. Validate tag base version matches pubspec.yaml base version (ignoring -rc* suffix). + # SENTRY_RELEASE uses the full pubspec version (including -rc* suffix) to match what the app reports. + TAG_BASE="${GITHUB_REF_NAME#v}" + TAG_BASE="${TAG_BASE%%-rc*}" PUBSPEC_VERSION=$(awk '/^version:/{split($2,a,"+"); print a[1]; exit}' pubspec.yaml) - PUBSPEC_VERSION="${PUBSPEC_VERSION%%-rc*}" - if [ "$PUBSPEC_VERSION" != "$TAG_VERSION" ]; then - echo "::error::Tag version ($TAG_VERSION) does not match pubspec version ($PUBSPEC_VERSION)." + PUBSPEC_BASE="${PUBSPEC_VERSION%%-rc*}" + if [ "$PUBSPEC_BASE" != "$TAG_BASE" ]; then + echo "::error::Tag version ($TAG_BASE) does not match pubspec version ($PUBSPEC_BASE)." exit 1 fi + SENTRY_RELEASE="$PUBSPEC_VERSION" + echo "Processing Sentry Release: $SENTRY_RELEASE" # 3. Find the xcarchive built by Fastlane. # Xcode always archives to ~/Library/Developer/Xcode/Archives — pick the most recent one. diff --git a/lib/main/utils/ios_sharing_manager.dart b/lib/main/utils/ios_sharing_manager.dart index 37336f359..c148f37f7 100644 --- a/lib/main/utils/ios_sharing_manager.dart +++ b/lib/main/utils/ios_sharing_manager.dart @@ -251,4 +251,4 @@ class IOSSharingManager { logWarning('IOSSharingManager::saveSentryConfigToKeychain: Exception: $e'); } } -} \ No newline at end of file +}