Skip to content

Commit 0f38946

Browse files
committed
VersionUpdate2.0.0
1 parent d97bf7c commit 0f38946

2 files changed

Lines changed: 49 additions & 11 deletions

File tree

.github/workflows/release-apk.yml

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ jobs:
114114
- name: Get Flutter dependencies
115115
run: flutter pub get
116116

117+
- name: Create .env file for CI
118+
run: |
119+
# Create empty .env file required by pubspec.yaml assets
120+
touch .env
121+
echo "Created .env placeholder for CI build"
122+
123+
- name: Generate code with build_runner
124+
run: |
125+
# Generate Hive adapters and other generated files
126+
dart run build_runner build --delete-conflicting-outputs
127+
echo "Code generation completed"
128+
117129
- name: Run Flutter analyze
118130
run: flutter analyze --no-fatal-infos
119131
continue-on-error: true # Don't fail on lint warnings
@@ -122,19 +134,40 @@ jobs:
122134
run: flutter test
123135
continue-on-error: true # Continue even if tests fail (for now)
124136

125-
- name: Build release APK
137+
- name: Build production release APKs (per-ABI)
126138
run: |
127139
flutter build apk --release \
140+
--split-per-abi \
141+
--obfuscate \
142+
--split-debug-info=build/debug-info \
128143
--build-name=${{ steps.version.outputs.version_name }} \
129144
--build-number=${{ steps.version.outputs.build_number }}
130145
131-
- name: Rename APK with version info
146+
- name: Rename APKs with version info
147+
id: apk_files
132148
run: |
133-
mv build/app/outputs/flutter-apk/app-release.apk \
134-
build/app/outputs/flutter-apk/${{ steps.version.outputs.apk_name }}
149+
VERSION="${{ steps.version.outputs.version_name }}"
150+
BUILD="${{ steps.version.outputs.build_number }}"
151+
SHA="${{ steps.version.outputs.short_sha }}"
152+
APK_DIR="build/app/outputs/flutter-apk"
153+
154+
# Rename each architecture-specific APK
155+
mv "${APK_DIR}/app-arm64-v8a-release.apk" \
156+
"${APK_DIR}/ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-arm64-v8a.apk"
157+
158+
mv "${APK_DIR}/app-armeabi-v7a-release.apk" \
159+
"${APK_DIR}/ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-armeabi-v7a.apk"
160+
161+
mv "${APK_DIR}/app-x86_64-release.apk" \
162+
"${APK_DIR}/ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-x86_64.apk"
163+
164+
# Output APK filenames for later steps
165+
echo "apk_arm64=ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-arm64-v8a.apk" >> $GITHUB_OUTPUT
166+
echo "apk_armv7=ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-armeabi-v7a.apk" >> $GITHUB_OUTPUT
167+
echo "apk_x86_64=ph-fare-calculator-v${VERSION}+${BUILD}-${SHA}-x86_64.apk" >> $GITHUB_OUTPUT
135168
136-
echo "APK renamed to: ${{ steps.version.outputs.apk_name }}"
137-
ls -la build/app/outputs/flutter-apk/
169+
echo "APKs renamed:"
170+
ls -la "${APK_DIR}"/*.apk
138171
139172
# ============================================
140173
# RELEASE
@@ -158,8 +191,11 @@ jobs:
158191
- **Workflow Run:** [#${{ github.run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
159192
160193
### APK Details
161-
- **Filename:** `${{ steps.version.outputs.apk_name }}`
162-
- **Architecture:** Universal (arm64-v8a, armeabi-v7a, x86_64)
194+
| Architecture | Filename |
195+
|-------------|----------|
196+
| **ARM64 (arm64-v8a)** | `${{ steps.apk_files.outputs.apk_arm64 }}` |
197+
| **ARM32 (armeabi-v7a)** | `${{ steps.apk_files.outputs.apk_armv7 }}` |
198+
| **x86_64** | `${{ steps.apk_files.outputs.apk_x86_64 }}` |
163199
164200
### Changes
165201
EOF
@@ -198,7 +234,9 @@ jobs:
198234
generate_release_notes: true # Also include GitHub's auto-generated notes
199235
append_body: true # Append our notes to GitHub's auto-generated ones
200236
files: |
201-
build/app/outputs/flutter-apk/${{ steps.version.outputs.apk_name }}
237+
build/app/outputs/flutter-apk/${{ steps.apk_files.outputs.apk_arm64 }}
238+
build/app/outputs/flutter-apk/${{ steps.apk_files.outputs.apk_armv7 }}
239+
build/app/outputs/flutter-apk/${{ steps.apk_files.outputs.apk_x86_64 }}
202240
fail_on_unmatched_files: true
203241
env:
204242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -212,7 +250,7 @@ jobs:
212250
echo "| **Tag** | \`${{ steps.tag_check.outputs.unique_tag }}\` |" >> $GITHUB_STEP_SUMMARY
213251
echo "| **Version** | ${{ steps.version.outputs.version_name }} |" >> $GITHUB_STEP_SUMMARY
214252
echo "| **Build** | ${{ steps.version.outputs.build_number }} |" >> $GITHUB_STEP_SUMMARY
215-
echo "| **APK** | \`${{ steps.version.outputs.apk_name }}\` |" >> $GITHUB_STEP_SUMMARY
253+
echo "| **APKs** | arm64-v8a, armeabi-v7a, x86_64 |" >> $GITHUB_STEP_SUMMARY
216254
echo "| **Commit** | \`${{ steps.version.outputs.short_sha }}\` |" >> $GITHUB_STEP_SUMMARY
217255
echo "" >> $GITHUB_STEP_SUMMARY
218256
echo "📦 [View Release](https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag_check.outputs.unique_tag }})" >> $GITHUB_STEP_SUMMARY

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1717
# In Windows, build-name is used as the major, minor, and patch parts
1818
# of the product and build number is used as the build suffix.
19-
version: 1.0.0+1
19+
version: 2.0.0+2
2020

2121
environment:
2222
sdk: ^3.9.2

0 commit comments

Comments
 (0)