codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
261 stars 42 forks source link

Bugfix: App Store and Testflight latest build numbers #300

Closed priitlatt closed 1 year ago

priitlatt commented 1 year ago

Changes in this pull request fix the actions that detect the latest build number from App Store Connect for App Store or Pre Release (TestFlight) versions:

In previous versions if --pre-release-version or --app-store-version argument was omitted, then the global latest version for an app was detected only based on build versions, which can lead to wrong results. For example consider the case where we have

In this case the expected latest build is from TestFlight version 1.0.1 with version number 3. But the previous versions pick build with number 999 from TestFlight version 0.0.1 since TestFlight versions were omitted from comparison entirely. Similar issue applies to App Store versions and their build.

Another minor change is that now the detected build number and TestFlight / App Store versions are logged out to STDERR stream. This is useful as the most common use-case for these actions is to capture the current latest build number into a shell variable, which can then be used to set the version of next build.

Example Old version: ```shell $ app-store-connect get-latest-build-number 1481211155 2.0.320.508 $ CURRENT_VERSION=$(app-store-connect get-latest-build-number 1481211155) $ echo $CURRENT_VERSION 2.0.320.508 ``` Updated version: ```shell $ app-store-connect get-latest-build-number 1481211155 Found build number 2.0.320.508 from TestFlight version 2.0.320 2.0.320.508 $ CURRENT_VERSION=$(app-store-connect get-latest-build-number 1481211155) Found build number 2.0.320.508 from TestFlight version 2.0.320 $ echo $CURRENT_VERSION 2.0.320.508 ```

Updated actions: