Last active
December 18, 2022 05:56
-
-
Save evelyne24/ba2930fb03299a9214850b7b5d301d85 to your computer and use it in GitHub Desktop.
Bash script to extract the build name and number from `pubspec.yaml` before building your Flutter app
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
#!/bin/bash | |
set -e | |
file=$(cat pubspec.yaml) | |
BUILD_NAME=$(echo $file | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p') | |
BUILD_NUMBER=$(git rev-list HEAD --count) | |
echo "Building version ${BUILD_NAME} ${BUILD_NUMBER}" | |
export BUILD_NAME="$BUILD_NAME" | |
export BUILD_NUMBER="$BUILD_NUMBER" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
build flutter : ios adhoc IPA + android APK + Upload
plist : replace teamID