Skip to content

Commit 7e6e5fe

Browse files
committed
tag for android
1 parent a228997 commit 7e6e5fe

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/ci_pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
branches:
1414
- "*"
1515

16+
permissions:
17+
contents: write
18+
1619
jobs:
1720
analyze:
1821
strategy:

.github/workflows/firebase-app-distribution.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ on:
1616
FIREBASE_APP_ID:
1717
required: true
1818

19+
permissions:
20+
contents: write
21+
1922
jobs:
2023
build-and-upload:
2124
runs-on: ubuntu-latest
@@ -47,6 +50,27 @@ jobs:
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:
@@ -68,3 +92,6 @@ jobs:
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 }}

0 commit comments

Comments
 (0)