Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Commit 7899c92

Browse files
committed
Update codemagic.yaml
1 parent 3ae4997 commit 7899c92

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

codemagic.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,13 @@ workflows:
155155
./gradlew clean test --no-daemon
156156
- name: Setup Gradle and Build RIA DigiDoc
157157
script: |
158+
# Get latest build numbers from "internal" and "production" tracks
158159
LATEST_GOOGLE_PLAY_INTERNAL_BUILD_NUMBER=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks internal)
159160
LATEST_GOOGLE_PLAY_PRODUCTION_BUILD_NUMBER=$(google-play get-latest-build-number --package-name "$PACKAGE_NAME" --tracks production)
160161
161-
echo "Internal Build Number: $INTERNAL_BUILD_NUMBER"
162-
echo "Release Build Number: $RELEASE_BUILD_NUMBER"
163-
164162
# Check that both tracks have valid build numbers (over 0) and select the highest.
165163
# Add +1 to the highest build number to submit to Google Play
164+
# If any are 0, use build number
166165
if [ "$LATEST_GOOGLE_PLAY_INTERNAL_BUILD_NUMBER" -gt 0 ] && [ "$LATEST_GOOGLE_PLAY_PRODUCTION_BUILD_NUMBER" -gt 0 ]; then
167166
if [ "$LATEST_GOOGLE_PLAY_INTERNAL_BUILD_NUMBER" -gt "$LATEST_GOOGLE_PLAY_PRODUCTION_BUILD_NUMBER" ]; then
168167
LATEST_BUILD_NUMBER=$(($LATEST_GOOGLE_PLAY_INTERNAL_BUILD_NUMBER + 1))
@@ -173,14 +172,15 @@ workflows:
173172
echo "Release build number is highest, new build number for this build: $LATEST_BUILD_NUMBER"
174173
echo LATEST_BUILD_NUMBER=$LATEST_BUILD_NUMBER >> $CM_ENV
175174
fi
176-
else
175+
else
177176
echo "One or both build numbers are 0, using build number"
178177
LATEST_BUILD_NUMBER="$APP_VERSION_NAME.$PROJECT_BUILD_NUMBER"
179178
fi
180179
181180
# Make latest build number be available in all build steps
182-
echo APP_VERSION=$APP_VERSION_NAME.$LATEST_BUILD_NUMBER >> $CM_ENV
183-
echo $APP_VERSION
181+
APP_VERSION="$APP_VERSION_NAME.$LATEST_BUILD_NUMBER"
182+
echo "APP_VERSION=$APP_VERSION" >> $CM_ENV
183+
echo "Using app version: $APP_VERSION"
184184
185185
# Build app
186186
./gradlew clean --no-daemon fetchAndPackageDefaultConfiguration -PappVersionName=$APP_VERSION -PappVersionCode=$LATEST_BUILD_NUMBER assembleRelease

0 commit comments

Comments
 (0)