Create script which builds the delverables and places them in a convenient place with convenient names.
This commit is contained in:
		
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -44,3 +44,6 @@ app.*.map.json
 | 
				
			|||||||
/android/app/release
 | 
					/android/app/release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/android/app/.*
 | 
					/android/app/.*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Ignore the releases folder.
 | 
				
			||||||
 | 
					releases/*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										46
									
								
								create_release_files.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										46
									
								
								create_release_files.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					#!/usr/bin/env bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DIR="$(dirname -- "${BASH_SOURCE[0]}")"
 | 
				
			||||||
 | 
					RELEASE_DIR=$DIR/releases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "*** Prepare for Builds ***"
 | 
				
			||||||
 | 
					cd $DIR
 | 
				
			||||||
 | 
					pwd
 | 
				
			||||||
 | 
					mkdir -pv $RELEASE_DIR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "*** Get Version ***"
 | 
				
			||||||
 | 
					grep 'version:' pubspec.yaml | while read v_text v_number; do
 | 
				
			||||||
 | 
						# Skip any newlines found while grepping.
 | 
				
			||||||
 | 
						if [[ -z $v_number ]]; then
 | 
				
			||||||
 | 
							continue
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo "Creating assets for version '$v_number'."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Set Up Variables
 | 
				
			||||||
 | 
						ANDROID_APK="build/app/outputs/flutter-apk/app-release.apk"
 | 
				
			||||||
 | 
						APK_RENAME="$RELEASE_DIR/ExpenseTracker_$v_number.apk"
 | 
				
			||||||
 | 
						LINUX_BUNDLE="build/linux/x64/release/bundle"
 | 
				
			||||||
 | 
						BUNDLE_RENAME="LinuxBundle_$v_number"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Build Android App
 | 
				
			||||||
 | 
						echo -e "\n*** Android APK ***"
 | 
				
			||||||
 | 
						rm -v "$APK_RENAME"
 | 
				
			||||||
 | 
						flutter build apk
 | 
				
			||||||
 | 
						mv -v $ANDROID_APK "$APK_RENAME"
 | 
				
			||||||
 | 
						ls -sh "$APK_RENAME"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Build Linux Project
 | 
				
			||||||
 | 
						echo -e "\n*** Linux Bundle ***"
 | 
				
			||||||
 | 
						rm -rv "$RELEASE_DIR/$BUNDLE_RENAME"*
 | 
				
			||||||
 | 
						flutter build linux
 | 
				
			||||||
 | 
						mv -v $LINUX_BUNDLE "$RELEASE_DIR/$BUNDLE_RENAME"
 | 
				
			||||||
 | 
						cd $RELEASE_DIR
 | 
				
			||||||
 | 
						zip -r $BUNDLE_RENAME.zip $BUNDLE_RENAME
 | 
				
			||||||
 | 
						rm -rv $BUNDLE_RENAME
 | 
				
			||||||
 | 
						ls -sh $BUNDLE_RENAME.zip
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						# Only one version should be found, but just in case, only use the top one!
 | 
				
			||||||
 | 
						break
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
		Reference in New Issue
	
	Block a user