-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.sh
executable file
·56 lines (49 loc) · 1.71 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
#!/bin/sh
sdk_name=renpy-$1-sdk
echo "Downloading the specified SDK (${sdk_name})..."
wget -q https://www.renpy.org/dl/$1/${sdk_name}.tar.bz2
clear
echo "Downloaded SDK version (${sdk_name})."
echo "Setting up the specified SDK (${sdk_name})..."
tar -xf ./${sdk_name}.tar.bz2
rm ./${sdk_name}.tar.bz2
mv ./${sdk_name} ../renpy
if [ $4 = "true" ]; then
steam_lib_name=renpy-$1-steam
echo "Downloading Steam lib (${steam_lib_name})..."
wget -q https://www.renpy.org/dl/$1/${steam_lib_name}.zip
clear
echo "Downloaded Steam lib (${steam_lib_name})..."
echo "Adding Steam lib to Renpy"
unzip -qq ./${steam_lib_name} -d ${steam_lib_name}
rsync -a ${steam_lib_name}/ ../renpy
rm -rf ${steam_lib_name} ${steam_lib_name}.zip
fi
# Note: This will be checked regardless of the version of Ren'Py. Caution is
# advised.
if [ -d "$2/old-game" ]; then
echo "old-game directory detected."
if [ -z "$(ls -A "$2/old-game")" ]; then
echo "ERROR: old-game is empty. This will cause incompatibility issues."
echo "For more information on how the old-game directory works and why"
echo "this directory should not be empty, please refer to the documentation"
echo "at: https://www.renpy.org/doc/html/build.html#old-game."
exit 1
fi
fi
case $3 in
pc|mac|linux|market|web|android)
COMMAND="../renpy/renpy.sh ../renpy/launcher distribute --package $3 $2"
;;
*)
COMMAND="../renpy/renpy.sh ../renpy/launcher distribute $2"
;;
esac
echo "Building the project at $2..."
if $COMMAND; then
built_dir=$(ls | grep '\-dists')
echo ::set-output name=dir::$built_dir
echo ::set-output name=version::${built_dir%'-dists'}
else
return 1
fi