-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from PAException/v1.0.0/bugfixes
1.0.1+0 release
- Loading branch information
Showing
44 changed files
with
371 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,5 +127,8 @@ app.*.symbols | |
**/*key.json | ||
**/*.p8 | ||
**/*.p12 | ||
.ipa | ||
.aab | ||
release/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/bin/bash | ||
|
||
####################################### | ||
# Flutter Version Increment and Build Script | ||
####################################### | ||
|
||
# Script Usage: | ||
# - This script must be executed from the root of the Flutter project. | ||
# - It increments the build number in the Flutter project's pubspec.yaml file. | ||
# - It provides options to increment the MAJOR, MINOR, or PATCH version components in | ||
# addition to the build number. | ||
# - Release builds for iOS and Android can be disabled using the --no-build option. | ||
# - The appBundle and ipa file are copied to the ./release directory. | ||
|
||
# Usage: | ||
# ./build_release [OPTIONS] | ||
|
||
# Available Options: | ||
# --major Increment the MAJOR version component. | ||
# --minor Increment the MINOR version component. | ||
# --patch Increment the PATCH version component. | ||
# => only one of the options above can be used at a time. | ||
# | ||
# --no-build Disable release builds for iOS and Android. | ||
|
||
ios_release_build() { | ||
# Build ipa | ||
flutter build ipa --release | ||
|
||
# Copy IPA file to release directory | ||
cp build/ios/ipa/*.ipa ./release | ||
} | ||
|
||
android_release_build() { | ||
# Build appBundle | ||
flutter build appbundle --release | ||
|
||
# Copy App Bundle file to release directory | ||
cp build/app/outputs/bundle/release/*.aab ./release | ||
} | ||
|
||
# Function to execute Flutter release builds for iOS and Android | ||
execute_flutter_release_builds() { | ||
# Ensure release directory exists; create if not present | ||
mkdir -p ./release | ||
|
||
ios_release_build | ||
android_release_build | ||
} | ||
|
||
# Function to increment version components in pubspec.yaml | ||
increment_flutter_version() { | ||
PUBSPEC_FILE="pubspec.yaml" | ||
CURRENT_VERSION=$(awk '/version:/ {print $2}' "$PUBSPEC_FILE" | tr -d "'") | ||
MAJOR=$(echo "$CURRENT_VERSION" | cut -d. -f1) | ||
MINOR=$(echo "$CURRENT_VERSION" | cut -d. -f2) | ||
PATCH=$(echo "$CURRENT_VERSION" | cut -d. -f3 | cut -d+ -f1) | ||
BUILD=$(echo "$CURRENT_VERSION" | cut -d+ -f2) | ||
|
||
if [ "$1" == "--major" ]; then | ||
NEW_VERSION="$((MAJOR + 1)).0.0+$((BUILD + 1))" | ||
elif [ "$1" == "--minor" ]; then | ||
NEW_VERSION="$MAJOR.$((MINOR + 1)).0+$((BUILD + 1))" | ||
elif [ "$1" == "--patch" ]; then | ||
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))+$((BUILD + 1))" | ||
else | ||
NEW_VERSION="$MAJOR.$MINOR.$PATCH+$((BUILD + 1))" | ||
fi | ||
|
||
awk -v current_version="$CURRENT_VERSION" -v new_version="$NEW_VERSION" \ | ||
'$1 == "version:" && $2 == current_version { $2 = new_version } { print }' \ | ||
"$PUBSPEC_FILE" > temp && mv temp "$PUBSPEC_FILE" | ||
|
||
echo "Flutter version incremented to $NEW_VERSION" | ||
} | ||
|
||
# Increment version based on provided options | ||
if [ "$1" == "--major" ] || [ "$1" == "--minor" ] || [ "$1" == "--patch" ]; then | ||
increment_flutter_version "$1" | ||
elif [ "$2" == "--major" ] || [ "$2" == "--minor" ] || [ "$2" == "--patch" ]; then | ||
increment_flutter_version "$2" | ||
else | ||
increment_flutter_version | ||
fi | ||
|
||
# Check for --no-build option to disable release builds | ||
if [[ "$1" == "--no-build" || "$2" == "--no-build" ]]; then | ||
echo "Release builds disabled." | ||
else | ||
execute_flutter_release_builds | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.