File tree Expand file tree Collapse file tree 4 files changed +27
-4
lines changed
Expand file tree Collapse file tree 4 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ packages:
6363 path: ".."
6464 relative: true
6565 source: path
66- version: "3.0.0 "
66+ version: "3.0.1 "
6767 crypto:
6868 dependency: transitive
6969 description:
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ description: Demonstrates how to use the courier_flutter plugin.
55# pub.dev using `flutter pub publish`. This is preferred for private packages.
66publish_to : ' none' # Remove this line if you wish to publish to pub.dev
77
8- version : 1.0.0+7
8+ version : 1.0.0+8
99
1010environment :
1111 sdk : ' >=2.18.1 <3.0.0'
Original file line number Diff line number Diff line change 11name : courier_flutter
22description : Inbox, Push Notifications and Preferences for Flutter
3- version : 3.0.1
3+ version : 3.0.2
44homepage : https://courier.com
55
66environment :
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # Function to increment build number
4+ increment_build_number () {
5+ local pubspec_file=" pubspec.yaml"
6+ if [ ! -f " $pubspec_file " ]; then
7+ echo " ❌ $pubspec_file not found."
8+ exit 1
9+ fi
10+
11+ local build_number=$( grep -E ' ^\s*version:' " $pubspec_file " | sed -E ' s/.*\+([0-9]+).*/\1/' )
12+ if [ -z " $build_number " ]; then
13+ echo " ❌ Build number not found in $pubspec_file ."
14+ exit 1
15+ fi
16+
17+ build_number=$(( build_number + 1 ))
18+ echo " Incrementing build number to $build_number ."
19+
20+ sed -i ' ' -E " s/(version: .+)\+[0-9]+/\1+$build_number /" " $pubspec_file "
21+ }
22+
323# Navigate to the example directory
424cd ../example || { echo " Failed to navigate to the example directory. Please ensure the path is correct." ; exit 1; }
525echo " Navigated to the example directory."
626
27+ # Increment Flutter build number
28+ increment_build_number
29+
730# Build Android app bundle
831echo " 🤖 Building Android app bundle..."
932flutter build appbundle
@@ -32,4 +55,4 @@ echo "✅ iOS app bundle built successfully."
3255# Open the iOS build in Xcode Organizer
3356open build/ios/archive/Runner.xcarchive
3457
35- echo " Both Android and iOS app bundles have been generated successfully."
58+ echo " Both Android and iOS app bundles have been generated successfully."
You can’t perform that action at this time.
0 commit comments