|
13 | 13 | version: |
14 | 14 | description: "Manual override version tag (optional)" |
15 | 15 | required: false |
16 | | - commit_version: |
17 | | - description: "Commit version update to git" |
18 | | - type: boolean |
19 | | - default: false |
20 | | - required: false |
21 | 16 |
|
22 | 17 | jobs: |
23 | 18 | build: |
@@ -63,40 +58,15 @@ jobs: |
63 | 58 | echo "storeFile=../upload-keystore.jks" >> key.properties |
64 | 59 | echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > upload-keystore.jks |
65 | 60 |
|
66 | | - - name: Update app version |
| 61 | + - name: Verify version files |
67 | 62 | run: | |
68 | 63 | cd mobile |
69 | | - # Update pubspec.yaml version to use Flutter format (version+build) |
70 | | - if [[ "$IMAGE_TAG" != "latest" ]]; then |
71 | | - # Remove 'v' prefix if present and create build number from git count with offset |
72 | | - VERSION_NAME=${IMAGE_TAG#v} |
73 | | - BUILD_NUMBER=$(($(git rev-list --count HEAD) + 20250000)) |
74 | | - sed -i "s/^version: .*/version: ${VERSION_NAME}+${BUILD_NUMBER}/" pubspec.yaml |
75 | | - |
76 | | - # Also update environment.dart constants |
77 | | - sed -i "s/static const _projectVersion = '[^']*';/static const _projectVersion = '${VERSION_NAME}';/" lib/core/environment.dart |
78 | | - sed -i "s/static const _build = '[^']*';/static const _build = '${BUILD_NUMBER}';/" lib/core/environment.dart |
79 | | - |
80 | | - echo "Updated version to ${VERSION_NAME}+${BUILD_NUMBER}" |
81 | | - fi |
| 64 | + echo "Current version in pubspec.yaml:" |
| 65 | + grep "^version:" pubspec.yaml |
| 66 | + echo "Current version in environment.dart:" |
| 67 | + grep "_projectVersion\|_build" lib/core/environment.dart |
| 68 | + echo "Build will use versions exactly as they are in the repository" |
82 | 69 |
|
83 | | - - name: Commit version update |
84 | | - if: github.event_name == 'release' || github.event.inputs.commit_version == 'true' |
85 | | - run: | |
86 | | - cd mobile |
87 | | - git config --local user.email "action@github.com" |
88 | | - git config --local user.name "GitHub Action" |
89 | | - git add pubspec.yaml lib/core/environment.dart |
90 | | - if ! git diff --staged --quiet; then |
91 | | - # Use the correct tag name based on trigger type |
92 | | - if [[ "${{ github.event_name }}" == "release" ]]; then |
93 | | - TAG_NAME="${{ github.event.release.tag_name }}" |
94 | | - else |
95 | | - TAG_NAME="${{ github.event.inputs.version || env.IMAGE_TAG }}" |
96 | | - fi |
97 | | - git commit -m "chore: update version to ${TAG_NAME} [skip ci]" |
98 | | - git push |
99 | | - fi |
100 | 70 |
|
101 | 71 | - name: Build APK |
102 | 72 | run: | |
|
0 commit comments