fix android version in build script

This commit is contained in:
Esteban Abaroa
2023-08-29 19:41:58 +00:00
parent 7c52d47335
commit ab72ff99b7
+7
View File
@@ -91,6 +91,9 @@ jobs:
contents: write contents: write
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
# needed to use 'git tag' and get all tags
fetch-depth: 0
- uses: actions/setup-java@v3 - uses: actions/setup-java@v3
with: with:
distribution: 'zulu' distribution: 'zulu'
@@ -106,6 +109,10 @@ jobs:
# build react app # build react app
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- run: CI='' yarn build - run: CI='' yarn build
# set android versionCode and versionName
- run: sed -i "s/versionCode 1/versionCode $(git tag | wc -l)/" ./android/app/build.gradle
- run: sed -i "s/versionName \"1.0\"/versionName \"$(node -e "console.log(require('./package.json').version)")\"/" ./android/app/build.gradle
- run: cat ./android/app/build.gradle
# build apk # build apk
- run: npx cap update - run: npx cap update
- run: npx cap copy - run: npx cap copy