forked from RhetTbull/osxphotos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·70 lines (55 loc) · 1.94 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# script to help build osxphotos release
# this is unique to my own dev setup
echo "Cleaning old build and dist directories"
rm -rf dist
rm -rf build
echo "Updated phototemplate.md"
cog -d -o osxphotos/phototemplate.md osxphotos/phototemplate.cog.md
echo "Updating README.md"
python3 utils/update_readme.py
cog -r README.md
echo "Updating API_README.md"
cog -r API_README.md
echo "Updating overview.rst"
cog -d -o docsrc/source/overview.rst docsrc/source/overview.cog.rst
# stage and convert markdown to rst
echo "Copying osxphotos/tutorial.md to docsrc/source/tutorial.md"
cp osxphotos/tutorial.md docsrc/source/tutorial.md
rm docsrc/source/tutorial.rst
m2r2 docsrc/source/tutorial.md
rm docsrc/source/tutorial.md
echo "Generating template help docs"
rm docsrc/source/template_help.rst
python3 utils/generate_template_docs.py
m2r2 docsrc/source/template_help.md
rm docsrc/source/template_help.md
echo "Copying API_README.md to docsrc/source/API_README.md"
rm docsrc/source/API_README.rst
cp API_README.md docsrc/source/API_README.md
m2r2 docsrc/source/API_README.md
rm docsrc/source/API_README.md
# build docs
echo "Building docs"
(cd docsrc && make github && make pdf)
# copy docs to osxphotos/docs/docs.zip for use with `osxphotos docs` command
echo "Zipping docs to osxphotos/docs/docs.zip"
rm osxphotos/docs/docs.zip
zip -r osxphotos/docs/docs.zip docs/* -x "docs/screencast/*"
# build the package
echo "Building package"
python3 -m build
# build CLI executable
echo "Building CLI executable"
./make_cli_exe.sh
# sign the executable
echo "Signing CLI executable"
codesign --force --sign "$DEVELOPER_ID_APPLICATION" dist/osxphotos
# zip up CLI executable
echo "Zipping CLI executable"
OSXPHOTOSVERSION=$(python3 -c "import osxphotos; print(osxphotos.__version__)")
ARCHSTR=$(uname -m)
ZIPNAME=osxphotos_MacOS_exe_darwin_${ARCHSTR}_v${OSXPHOTOSVERSION}.zip
echo "Zipping CLI executable to $ZIPNAME"
cd dist && zip $ZIPNAME osxphotos && cd ..
rm dist/osxphotos