@@ -18,9 +18,15 @@ echo "Preparing release version: $VERSION"
1818# Store the project root directory reliably
1919PROJECT_ROOT=$( cd " $( dirname " $0 " ) /.." && pwd)
2020
21+ # Define output paths
22+ APK_DIR=" ${PROJECT_ROOT} /build/app/outputs/flutter-apk"
23+ AAB_DIR=" ${PROJECT_ROOT} /build/app/outputs/bundle/release"
24+ APK_FILE=" FosterSquirrel-v${VERSION} .apk"
25+ AAB_FILE=" FosterSquirrel-v${VERSION} .aab"
26+
2127# Update pubspec.yaml with new version
2228echo " Updating pubspec.yaml..."
23- sed -i " s/^version: .*/version: ${VERSION} /" pubspec.yaml
29+ sed -i " s/^version: .*/version: ${VERSION} /" " ${PROJECT_ROOT} / pubspec.yaml"
2430
2531# Build Android APK
2632echo " Building release APK..."
@@ -30,24 +36,16 @@ flutter build apk --release
3036echo " Building release App Bundle..."
3137flutter build appbundle --release
3238
33- # Rename APK with version
34- echo " Renaming APK..."
35- mv build/app/outputs/flutter-apk/app-release.apk \
36- build/app/outputs/flutter-apk/FosterSquirrel-v${VERSION} .apk
37-
38- # Rename AAB with version
39- echo " Renaming App Bundle..."
40- mv build/app/outputs/bundle/release/app-release.aab \
41- build/app/outputs/bundle/release/FosterSquirrel-v${VERSION} .aab
42-
43- # Generate SHA256 checksum for APK
44- echo " Generating APK checksum..."
45- cd " ${PROJECT_ROOT} /build/app/outputs/flutter-apk"
46- sha256sum FosterSquirrel-v${VERSION} .apk > FosterSquirrel-v${VERSION} .apk.sha256
39+ # Rename and generate checksums for APK
40+ echo " Processing APK..."
41+ mv " ${APK_DIR} /app-release.apk" " ${APK_DIR} /${APK_FILE} "
42+ sha256sum " ${APK_DIR} /${APK_FILE} " > " ${APK_DIR} /${APK_FILE} .sha256"
4743
48- # Generate SHA256 checksum for AAB
49- echo " Generating App Bundle checksum ..."
50- cd " ${PROJECT_ROOT} /build/ app/outputs/bundle/ release"
51- sha256sum FosterSquirrel-v ${VERSION} .aab > FosterSquirrel-v ${VERSION} .aab. sha256
44+ # Rename and generate checksums for AAB
45+ echo " Processing App Bundle..."
46+ mv " ${AAB_DIR} / app- release.aab " " ${AAB_DIR} / ${AAB_FILE} "
47+ sha256sum " ${AAB_DIR} / ${AAB_FILE} " > " ${AAB_DIR} / ${AAB_FILE} . sha256"
5248
5349echo " ✅ Release preparation complete for version $VERSION "
50+ echo " APK: ${APK_DIR} /${APK_FILE} "
51+ echo " AAB: ${AAB_DIR} /${AAB_FILE} "
0 commit comments