Skip to content

Commit 5952681

Browse files
committed
🚀 Bump version to 3.0.1
1 parent 165ec86 commit 5952681

File tree

5 files changed

+57
-13
lines changed

5 files changed

+57
-13
lines changed

deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ declare -a steps=(
1515
"Build Demo App:sh build_demo_app.sh"
1616
"Update Build Version:sh update_version.sh"
1717
"Create Git Release:sh git_release.sh"
18-
"Release Cocoapod:sh release_pod.sh"
18+
"Publish Package:sh pub_publish.sh"
1919
)
2020

2121
# Display available steps with indices

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.4.1"
66+
version: "3.0.0"
6767
crypto:
6868
dependency: transitive
6969
description:

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: 3.0.0
3+
version: 3.0.1
44
homepage: https://courier.com
55

66
environment:

push.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

scripts/pub_publish.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# Change to the root directory
4+
cd "$(dirname "$0")/.."
5+
6+
# Define ANSI color codes
7+
ORANGE='\033[0;33m'
8+
GREEN='\033[0;32m'
9+
NC='\033[0m' # No Color
10+
11+
# Function to handle errors and exit
12+
error_exit() {
13+
echo -e "❌ Error: $1" >&2
14+
exit 1
15+
}
16+
17+
# Function to log in to pub.dev if not already logged in
18+
login_to_pub() {
19+
if ! dart pub cache repair >/dev/null 2>&1; then
20+
echo -e "${ORANGE}⚠️ Logging in to pub.dev...${NC}"
21+
dart pub login || error_exit "Failed to log in to pub.dev. Please log in manually and retry."
22+
else
23+
echo -e "${GREEN}✅ Already logged in to pub.dev.${NC}"
24+
fi
25+
}
26+
27+
# Function to publish the package
28+
publish_package() {
29+
# Navigate to the package directory
30+
cd "$(dirname "$0")" || error_exit "Failed to change directory."
31+
32+
# Run a dry run to preview the publication
33+
echo -e "${ORANGE}⚠️ Running dry run to preview publication...${NC}"
34+
dart pub publish --dry-run
35+
read -p "Proceed with publishing? (y/n): " confirmation
36+
37+
if [[ $confirmation == "y" || $confirmation == "Y" ]]; then
38+
# Run the actual publish command
39+
echo -e "${ORANGE}⚠️ Publishing the package...${NC}"
40+
dart pub publish --force || error_exit "Failed to publish the package."
41+
echo -e "${GREEN}✅ Package successfully published to pub.dev.${NC}"
42+
else
43+
echo "Publication process canceled."
44+
fi
45+
}
46+
47+
# Main script execution
48+
echo -e "${ORANGE}⚠️ Starting the Flutter package publish script...${NC}"
49+
50+
# Log in to pub.dev if needed
51+
login_to_pub
52+
53+
# Publish the package
54+
publish_package

0 commit comments

Comments
 (0)