diff --git a/.github/workflows/versioning-and-deployment.yaml b/.github/workflows/versioning-and-deployment.yaml index 54c17ba..3e96660 100644 --- a/.github/workflows/versioning-and-deployment.yaml +++ b/.github/workflows/versioning-and-deployment.yaml @@ -25,10 +25,15 @@ jobs: run: | # Get the current versionCode from build.gradle VERSION_CODE=$(grep versionCode ./Nabi/presentation/build.gradle.kts | sed 's/[^0-9]*//g') + echo "Current versionCode: $VERSION_CODE" + # Increment the versionCode NEW_VERSION_CODE=$((VERSION_CODE + 1)) + echo "New versionCode: $NEW_VERSION_CODE" + # Replace the old versionCode with the new one in build.gradle sed -i "s/versionCode $VERSION_CODE/versionCode $NEW_VERSION_CODE/" ./Nabi/presentation/build.gradle.kts + # Check if there are changes to commit if [ $(git status --porcelain | wc -l) -gt 0 ]; then git config --global user.name "${{ secrets.GIT_USER_NAME }}" @@ -39,9 +44,14 @@ jobs: else echo "changed=false" >> $GITHUB_ENV fi + + - name: Show git status + run: git status + - name: Push changes if: env.changed == 'true' run: | + echo "Pushing changes to version-update branch" git push origin version-update merge_version_update: @@ -53,11 +63,18 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Merge version-update branch + - name: Show current branch run: | + echo "Current branch:" + git branch + echo "Fetching remote branches" git fetch origin + + - name: Merge version-update branch + run: | git checkout develop git merge origin/version-update + echo "Pushing changes to develop branch" git push origin develop build_and_upload: @@ -80,25 +97,35 @@ jobs: java-version: '17' - name: Grant execute permission for gradlew - run: chmod +x ./Nabi/gradlew + run: | + echo "Granting execute permission for gradlew" + chmod +x ./Nabi/gradlew - name: Decode and save keystore - run: echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./Nabi/presentation/keystore.jks + run: | + echo "Decoding and saving keystore" + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > ./Nabi/presentation/keystore.jks - name: Verify keystore run: | + echo "Listing files in ./Nabi/presentation/" ls -alh ./Nabi/presentation/ echo "Checking JKS format..." keytool -list -v -keystore ./Nabi/presentation/keystore.jks -storetype JKS || echo "JKS format verification failed" - name: Create google-services.json - run: echo "$GOOGLE_SERVICES_JSON" > ./Nabi/presentation/google-services.json + run: | + echo "Creating google-services.json" + echo "$GOOGLE_SERVICES_JSON" > ./Nabi/presentation/google-services.json - name: Create local.properties - run: echo "$LOCAL_PROPERTIES_CONTENTS" > ./Nabi/local.properties + run: | + echo "Creating local.properties" + echo "$LOCAL_PROPERTIES_CONTENTS" > ./Nabi/local.properties - name: Build release APK run: | + echo "Building release APK" cd ./Nabi ./gradlew assembleRelease