Skip to content

Commit dc33b14

Browse files
committed
Fixing version code update in github workflow
1 parent b215747 commit dc33b14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/build-android.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@ jobs:
7979
- name: Update Version Code in Android build
8080
working-directory: ./android
8181
run: |
82+
GRADLE_FILE=./app/build/.gradle
83+
8284
# Get curent version from build.gradle
83-
VERSION_CODE=$(grep versionCode ./build.gradle | awk '{print $2}') || error "Failed to read Android versionCode"
85+
VERSION_CODE=$(grep versionCode $GRADLE_FILE | awk '{print $2}') || error "Failed to read Android versionCode"
8486
# Tack on the date including the hour and min
85-
VERSION_CODE="$VERSION_CODE_$(date '+%Y%m%d%H%M')""
87+
DATE_CODE=$(date '+%Y%m%d%H%M')
8688
8789
# Update capacitor.config.json version code
88-
sed -i "" "s/versionCode .*/versionCode $VERSION_CODE/" ./build.gradle || error "Failed to update Android versionCode"
90+
sed -i "" "s/versionCode .*/versionCode ${VERSION_CODE}.${DATE_CODE}/" $GRADLE_FILE || error "Failed to update Android versionCode"
8991
9092
- name: npm build-mobile
9193
run: npm run build-mobile

0 commit comments

Comments
 (0)