0.1.2 #1
+59
-12
@@ -1,23 +1,70 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# 20260913 - Hyperling
|
# 20260913 - Hyperling
|
||||||
# Build the project and add them to a releases folder.
|
# Build the project and add the output to a releases folder.
|
||||||
|
|
||||||
# TODO
|
## Setup ##
|
||||||
# create dir name release-${version} to store these in,
|
|
||||||
|
|
||||||
echo -e "\nCleaning..."
|
DIR="$(cd "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||||
|
|
||||||
|
## Functions ##
|
||||||
|
|
||||||
|
function log {
|
||||||
|
echo -e "\n $@ \n"
|
||||||
|
}
|
||||||
|
|
||||||
|
function clean_flutter {
|
||||||
|
log "Cleaning..."
|
||||||
flutter clean
|
flutter clean
|
||||||
|
}
|
||||||
|
|
||||||
echo -e "\nBuilding Linux..."
|
## Variables ##
|
||||||
|
|
||||||
|
app_details="$DIR/pubspec.yaml"
|
||||||
|
|
||||||
|
name=""
|
||||||
|
for i in `grep name $app_details`; do
|
||||||
|
name="$i"
|
||||||
|
done
|
||||||
|
name="${name// /_}"
|
||||||
|
|
||||||
|
version=""
|
||||||
|
for i in `grep version $app_details`; do
|
||||||
|
version="$i"
|
||||||
|
done
|
||||||
|
version="v${version// /_}"
|
||||||
|
|
||||||
|
if [[ -z $name || -z $version ]]; then
|
||||||
|
echo "ERROR: Could not retrieve name or version. name='$name' version='$version'"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RELEASE="release/$name-$version"
|
||||||
|
echo "Running for '$RELEASE'."
|
||||||
|
|
||||||
|
## Main ##
|
||||||
|
|
||||||
|
clean_flutter
|
||||||
|
|
||||||
|
log "Building Linux Bundle..."
|
||||||
flutter build linux
|
flutter build linux
|
||||||
zip -r release/linux-bundle.zip build/linux/x64/release/bundle/*
|
|
||||||
|
|
||||||
echo -e "\nCleaning..."
|
log "Saving Linux Bundle..."
|
||||||
flutter clean
|
filename=$RELEASE.linux-bundle.zip
|
||||||
|
if [[ -e $filename ]]; then
|
||||||
|
rm -v $filename
|
||||||
|
fi
|
||||||
|
zip -r $filename build/linux/x64/release/bundle/*
|
||||||
|
ls -sh $filename
|
||||||
|
|
||||||
echo -e "\nBuilding APK..."
|
clean_flutter
|
||||||
|
|
||||||
|
log "Building APK..."
|
||||||
flutter build apk
|
flutter build apk
|
||||||
cp -v build/app/outputs/flutter-apk/app-release.apk release/
|
|
||||||
|
|
||||||
echo -e "\nCleaning..."
|
log "Saving APK..."
|
||||||
flutter clean
|
filename=$RELEASE.apk
|
||||||
|
if [[ -e $filename ]]; then
|
||||||
|
rm -v $filename
|
||||||
|
fi
|
||||||
|
cp -v build/app/outputs/flutter-apk/app-release.apk $filename
|
||||||
|
ls -sh $filename
|
||||||
Reference in new issue
Block a user