File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 branches :
1414 - " *"
1515
16+ permissions :
17+ contents : write
18+
1619jobs :
1720 analyze :
1821 strategy :
Original file line number Diff line number Diff line change 1616 FIREBASE_APP_ID :
1717 required : true
1818
19+ permissions :
20+ contents : write
21+
1922jobs :
2023 build-and-upload :
2124 runs-on : ubuntu-latest
4750 - name : ✅ Confirm keystore file exists
4851 run : ls -l android/app/ci-release-key.keystore
4952
53+ - name : 🧮 Bump versionCode
54+ id : bump_version
55+ run : |
56+ VERSION_NAME=$(grep version: pubspec.yaml | awk '{print $2}')
57+ VERSION_CODE=$(grep versionCode android/app/build.gradle | awk '{print $2}')
58+ echo "Current version: $VERSION_NAME+$VERSION_CODE"
59+
60+ NEW_CODE=$((VERSION_CODE + 1))
61+
62+ # Update versionCode
63+ sed -i "s/versionCode $VERSION_CODE/versionCode $NEW_CODE/" android/app/build.gradle
64+
65+ # Commit and push
66+ git config user.name "GitHub Actions"
67+ git config user.email "[email protected] " 68+ git add android/app/build.gradle
69+ git commit -m "⬆️ Bump versionCode to $NEW_CODE for $VERSION_NAME"
70+ git tag "Android_v$VERSION_NAME+$NEW_CODE"
71+
72+ echo "VERSION_TAG=v$VERSION_NAME+$NEW_CODE" >> $GITHUB_ENV
73+
5074 - name : 🏗️ Build Universal Release APK
5175 run : flutter build apk --release
5276 env :
6892 firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk \
6993 --app ${{ secrets.FIREBASE_APP_ID }} \
7094 --groups "Internal"
95+
96+ - name : 📤 Push tag to GitHub
97+ run : git push origin ${{ env.VERSION_TAG }}
You can’t perform that action at this time.
0 commit comments