aboutsummaryrefslogtreecommitdiff
path: root/make_release.sh
blob: d6ae82a0555fb62aeb165976ef60196bb6eda65d (plain)
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
#!/bin/sh

# get version argument
VERS="$1"
if [ ! "$VERS" ];then
   echo "Argument version expected: example ./make_release.sh 2.5.0"
   exit 1
fi

# cd to root dir
cd "$(dirname "$0")"
AROOT="$(pwd)"
echo "Working directory is: $AROOT"
# create temp directory
TMP=$(mktemp -d -t advtrains-XXXX)
echo "Temp directory is: $TMP"
mkdir "$TMP/advtrains"
TDIR="$TMP/advtrains/"

# copy dirs
cp -r "advtrains" "$TDIR"
cp -r "advtrains_interlocking" "$TDIR"
cp -r "advtrains_line_automation" "$TDIR"
cp -r "advtrains_luaautomation" "$TDIR"
cp -r "advtrains_signals_ks" "$TDIR"
cp -r "advtrains_signals_japan" "$TDIR"
cp -r "advtrains_signals_muc_ubahn" "$TDIR"
cp -r "advtrains_train_track" "$TDIR"
cp -r "serialize_lib" "$TDIR"

# copy files
cp "atc_command.txt" "$TDIR"
cp "description.txt" "$TDIR"
cp "license.txt" "$TDIR"
cp "license_media.txt" "$TDIR"
cp "modpack.conf" "$TDIR"
cp "privilege_guide.txt" "$TDIR"
cp "README.md" "$TDIR"
cp "screenshot.png" "$TDIR"

# compress to zip archive
ZIPNAME="$AROOT/advtrains_$VERS.zip"
echo "Target ZIP file is: $ZIPNAME"
cd "$TMP"
zip -r "$ZIPNAME" "advtrains"
cd "$AROOT"

# success
echo "Release $VERS created at: $ZIPNAME"

# remove tempdir
rm -rf "$TMP"