script changes (#524)

This commit is contained in:
Yogesh Choudhary Paliyal
2023-05-09 23:24:57 +05:30
committed by GitHub
parent eaf2e3a53e
commit 1c111f732b
2 changed files with 30 additions and 0 deletions

View File

@@ -25,6 +25,23 @@ jobs:
- name: Build APK ⚙️🛠
run: bash ./gradlew assembleStagingDebug
- name: 🏗 Master Bump App Version
id: bump-app-version
run: |
newVersion=$(bash ./scripts/masterVersion.sh)
echo "::newVersion::$newVersion"
echo "newVersion=$newVersion" >> "$GITHUB_OUTPUT"
env:
TYPE: ${{ inputs.type }}
RELEASE_NOTES: ${{ inputs.releaseNote }}
- name: Git Add and Commit
run: |
git config --global user.name 'Yogesh Choudhary Paliyal'
git config --global user.email 'yogeshpaliyal@users.noreply.github.com'
git add .
git commit -am "Github Actions: App version Bumped to ${{ steps.bump-app-version.outputs.newVersion }}"
- uses: "marvinpinto/action-automatic-releases@latest"
with:

13
scripts/masterVersion.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Read the current versionCode and versionName from the build.gradle file
VERSION_NAME=$(grep "versionName" app/build.gradle | awk '{print $2}' | tr -d '\r''"')
NEW_VERSION_NAME="$VERSION_NAME-master"
# Update the build.gradle file with the new versionCode and versionName values
sed -i "s/versionName \"$VERSION_NAME\"/versionName \"$NEW_VERSION_NAME\"/" app/build.gradle
# Output the new versionCode and versionName values
echo "v$NEW_VERSION_NAME"