-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·47 lines (26 loc) · 983 Bytes
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
echo "fetching all tags ..."
git fetch --tags
echo "done fetching all tags"
lastversionandbuildnumber=`git tag -l | tail -1`
lastversion=`echo $lastversionandbuildnumber | cut -d "+" -f 1`
lastbuildnumber=`echo $lastversionandbuildnumber | cut -d "+" -f 2`
echo "last version is $lastversionandbuildnumber"
newbuildnumber=`expr $lastbuildnumber + 1`
line="version:.*"
rep="version: $lastversion+$newbuildnumber"
echo "new version $lastversion+$newbuildnumber"
sed -e "s/${line}/${rep}/g" pubspec.yaml > pubspec-new.yaml
mv pubspec-new.yaml pubspec.yaml
echo "Building project ..."
# flutter build web --web-renderer html
flutter build web --web-renderer html -t lib/main.dart --no-tree-shake-icons
echo "Deploying project ..."
firebase deploy
git add pubspec.yaml
git commit -m "version bumped to $lastversion+$newbuildnumber"
echo "Adding tag on Git ..."
git tag "$lastversion+$newbuildnumber"
echo "Pushing tag on Git ..."
git push --tags
git push
echo "Done"