-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·51 lines (43 loc) · 1.3 KB
/
build.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
48
49
50
51
#!/usr/bin/env bash
if [ -z "${VIRTUAL_ENV}" ]; then
echo "Make sure you run this script from within the"
echo "Python Virtual environment of this project"
exit 1
fi
if [ "$1" == "release" ] && [ ! -z "$(git diff --stat)" ]; then
echo "Can not release as the project is 'dirty'."
echo "Please make sure to commit everything before running a release build"
exit 1
fi
has_create_dmg="$(which create-dmg)"
if [ -z "$has_create_dmg" ]; then
echo "create-dmg is not installed."
echo "if you want to make a release please make sure to install it first!"
if [ "$1" == "release" ]; then
exit 1
fi
fi
if [ "$1" == "clean" ] || [ "$1" == "release" ]; then
echo "Cleaning..."
if [ -d "./dist" ]; then
rm -rf "./dist" "./build" 2>/dev/null
fi
fi
echo "Versioning..."
python ./version.py
echo "Building..."
./images.sh
python -OO -m PyInstaller --osx-bundle-identifier nl.ivonet.m4baker --noconsole -y m4baker.spec
echo "Tagging..."
./tag.sh
if [ "$1" == "release" ]; then
echo "Packaging..."
if [ -z "$has_create_dmg" ]; then
echo "Not creating DMG release as create-dmg is not installed."
else
cd ./dist
version=$(<../VERSION)
create-dmg --app-drop-link 10 30 M4Baker_${version}.dmg M4Baker.app
sha512sum "M4Baker_${version}.dmg" >"M4Baker_${version}.dmg.sha512"
fi
fi