Skip to content

Commit d0a47e8

Browse files
committed
Bump
1 parent 9a4ad26 commit d0a47e8

File tree

7 files changed

+108
-3
lines changed

7 files changed

+108
-3
lines changed

build.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
3+
# Navigate to the example directory
4+
cd example || { echo "Failed to navigate to the example directory. Please ensure the path is correct."; exit 1; }
5+
echo "Navigated to the example directory."
6+
7+
sh ../dist.sh
8+
9+
# Build Android app bundle
10+
echo "🤖 Building Android app bundle..."
11+
flutter build appbundle
12+
13+
if [ $? -ne 0 ]; then
14+
echo "❌ Failed to build Android app bundle."
15+
exit 1
16+
fi
17+
18+
echo "✅ Android app bundle built successfully."
19+
20+
# Open the Android build folder in Finder
21+
open build/app/outputs/bundle/release
22+
23+
# Build iOS app bundle
24+
echo "🍎 Building iOS app bundle..."
25+
flutter build ipa --release
26+
27+
if [ $? -ne 0 ]; then
28+
echo "❌ Failed to build iOS app bundle."
29+
exit 1
30+
fi
31+
32+
echo "✅ iOS app bundle built successfully."
33+
34+
# Open the iOS build in Xcode Organizer
35+
open build/ios/archive/Runner.xcarchive
36+
37+
echo "Both Android and iOS app bundles have been generated successfully."

dist.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
# Define ANSI color codes
4+
ORANGE='\033[0;33m'
5+
NC='\033[0m' # No Color
6+
7+
# Function to read the current version from pubspec.yaml
8+
get_current_version() {
9+
grep '^version:' pubspec.yaml | awk '{print $2}'
10+
}
11+
12+
# Function to parse the version and suggest the next version
13+
suggest_next_version() {
14+
local current_version=$1
15+
local base_version=$(echo $current_version | awk -F '+' '{print $1}')
16+
local build_metadata=$(echo $current_version | awk -F '+' '{print $2}')
17+
18+
if [[ -n $build_metadata ]]; then
19+
local next_build=$((build_metadata + 1))
20+
echo "${base_version}+${next_build}"
21+
else
22+
IFS='.' read -r -a version_parts <<< "$base_version"
23+
local next_patch=$((version_parts[2] + 1))
24+
echo "${version_parts[0]}.${version_parts[1]}.$next_patch"
25+
fi
26+
}
27+
28+
# Function to update the version in pubspec.yaml
29+
update_version() {
30+
local new_version=$1
31+
sed -i '' "s/^version:.*/version: $new_version/" pubspec.yaml
32+
}
33+
34+
# Get the current version
35+
current_version=$(get_current_version)
36+
echo "Current version: ${ORANGE}$current_version${NC}"
37+
38+
# Suggest the next version
39+
suggested_version=$(suggest_next_version "$current_version")
40+
echo "Suggested next version: ${ORANGE}$suggested_version${NC}"
41+
42+
# Prompt the user for the new version
43+
read -p "Enter the new version (or press Enter to use suggested version): " user_version
44+
new_version=${user_version:-$suggested_version}
45+
46+
# Ask for confirmation
47+
echo "You entered version ${ORANGE}$new_version${NC}"
48+
read -p "Do you want to update the version in pubspec.yaml? (y/n): " confirmation
49+
50+
if [[ $confirmation == "y" || $confirmation == "Y" ]]; then
51+
# Update the version in pubspec.yaml
52+
update_version "$new_version"
53+
echo "Version updated to: ${ORANGE}$new_version${NC}"
54+
else
55+
echo "Version update canceled."
56+
fi

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ packages:
6363
path: ".."
6464
relative: true
6565
source: path
66-
version: "2.3.0"
66+
version: "2.4.0"
6767
crypto:
6868
dependency: transitive
6969
description:

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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.
66
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
77

8-
version: 1.0.0+6
8+
version: 1.0.0+5
99

1010
environment:
1111
sdk: '>=2.18.1 <3.0.0'

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: courier_flutter
22
description: Inbox, Push Notifications and Preferences for Flutter
3-
version: 2.3.0
3+
version: 2.4.0
44
homepage: https://courier.com
55

66
environment:

push.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Update the SDK build
4+
sh dist.sh
5+
6+
# Release the SDK
7+
sh release.sh
8+
9+
# Build the demo apps
10+
sh build.sh

release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Install Github CLI if needed
24
#brew install gh
35
#gh auth login

0 commit comments

Comments
 (0)