Skip to content

Commit 2ea9087

Browse files
committed
🚀 3.0.0
1 parent de6ab9c commit 2ea9087

File tree

7 files changed

+127
-34
lines changed

7 files changed

+127
-34
lines changed

deploy.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ declare -a steps=(
1414
"Run Tests:sh run_tests.sh"
1515
"Build Demo App:sh build_demo_app.sh"
1616
"Update Build Version:sh update_version.sh"
17-
"Install Brew:sh install_homebrew.sh"
1817
"Create Git Release:sh git_release.sh"
1918
"Release Cocoapod:sh release_pod.sh"
2019
)

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

66
environment:

release.sh

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

build.sh renamed to scripts/build_demo_app.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#!/bin/bash
22

33
# Navigate to the example directory
4-
cd example || { echo "Failed to navigate to the example directory. Please ensure the path is correct."; exit 1; }
4+
cd ../example || { echo "Failed to navigate to the example directory. Please ensure the path is correct."; exit 1; }
55
echo "Navigated to the example directory."
66

7-
sh ../dist.sh
8-
97
# Build Android app bundle
108
echo "🤖 Building Android app bundle..."
119
flutter build appbundle

scripts/git_release.sh

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
NC='\033[0m' # No Color
9+
10+
# Function to handle errors and exit
11+
error_exit() {
12+
echo -e "❌ Error: $1" >&2
13+
exit 1
14+
}
15+
16+
# Function to get the package version from pubspec.yaml
17+
get_package_version() {
18+
local version=$(yq .version pubspec.yaml | tr -d '"')
19+
echo "$version"
20+
}
21+
22+
# Function to get the current Git branch
23+
get_current_branch() {
24+
git rev-parse --abbrev-ref HEAD
25+
}
26+
27+
# Function to run git status
28+
run_git_status() {
29+
git status
30+
}
31+
32+
# Function to add all changes and commit with message including version
33+
add_commit() {
34+
local version="$1"
35+
git add -A
36+
git commit -m "🚀 $version"
37+
}
38+
39+
# Function to merge the current branch into master
40+
merge_into_master() {
41+
local branch=$(get_current_branch)
42+
git checkout master
43+
git merge --no-ff "$branch"
44+
git push origin master
45+
git checkout "$branch"
46+
}
47+
48+
# Function to install GitHub CLI if not already installed
49+
install_gh_cli() {
50+
if ! which gh >/dev/null 2>&1; then
51+
echo -e "${ORANGE}⚠️ Installing GitHub CLI...${NC}"
52+
brew install gh || error_exit "Failed to install GitHub CLI. Please install it manually and retry."
53+
fi
54+
}
55+
56+
# Function to create GitHub release
57+
create_github_release() {
58+
local version="$1"
59+
echo -e "${ORANGE}⚠️ Creating GitHub release for version $version...${NC}\n"
60+
gh release create "$version" --notes "Release for version $version"
61+
echo "✅ GitHub release $version created\n"
62+
}
63+
64+
# Main script execution
65+
# Check if GitHub CLI is installed
66+
install_gh_cli
67+
68+
# Get the package version from pubspec.yaml
69+
current_version=$(get_package_version)
70+
echo "Current version is $current_version"
71+
72+
# Ask for confirmation to merge into master with versioned commit
73+
read -p "Merge into master and create release with commit: '🚀 $current_version'? (y/n): " confirmation
74+
75+
if [[ $confirmation == "y" || $confirmation == "Y" ]]; then
76+
# Perform the Git operations
77+
run_git_status
78+
add_commit "$current_version"
79+
merge_into_master
80+
81+
# Tag the new version
82+
git tag "$current_version"
83+
git push --tags
84+
85+
# Create the GitHub release
86+
create_github_release "$current_version"
87+
else
88+
echo "Merge and release process canceled."
89+
fi

scripts/run_tests.sh

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,36 @@
33
# Change to the root directory
44
cd ../example || exit
55

6-
# Run tests
7-
flutter test integration_test/client_tests.dart
6+
# Function to run the tests with the selected device ID
7+
run_tests() {
8+
flutter test integration_test/client_tests.dart --device-id="$DEVICE_ID"
9+
flutter test integration_test/shared_tests.dart --device-id="$DEVICE_ID"
10+
}
11+
12+
# Function to prompt the user to select a device and run the tests
13+
select_device_and_run_tests() {
14+
# List available devices
15+
echo "Listing available devices..."
16+
flutter devices
17+
18+
# Prompt the user to enter the device ID
19+
echo "Please enter the device ID to run the tests on:"
20+
read -r DEVICE_ID
21+
22+
# Run the tests with the selected device ID
23+
run_tests
24+
25+
# Ask the user if they want to rerun the tests
26+
while true; do
27+
echo "Do you want to rerun the tests or end the script? (r to rerun, e to exit):"
28+
read -r REPLY
29+
case $REPLY in
30+
[Rr]* ) select_device_and_run_tests; break;;
31+
[Ee]* ) echo "Exiting."; exit;;
32+
* ) echo "Please answer 'r' to rerun or 'e' to exit.";;
33+
esac
34+
done
35+
}
36+
37+
# Start the process
38+
select_device_and_run_tests

dist.sh renamed to scripts/update_version.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Change to the root directory
4+
cd "$(dirname "$0")/.."
5+
36
# Define ANSI color codes
47
ORANGE='\033[0;33m'
58
NC='\033[0m' # No Color

0 commit comments

Comments
 (0)