annotate tools/make_dist.sh @ 33:767970d80214

Added tag 0.10.0 for changeset 85d23328a215
author ark
date 2026-10-20 18:39 +0200
parents 75deda08db90
children a464bd43b76c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
1 #!/bin/sh
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
2 USAGE="$0 [--debug]
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
3
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
4 build the game and pack www/ into dist/minor_monsters_<version>.tar.gz,
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
5 which unpacks into a directory minor_monsters. the version comes from
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
6 tools/get_version.sh -f: the latest tag, with a timestamp appended when
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
7 the working directory is not clean or not at the tagged revision.
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
8
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
9 options:
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
10 -h, --help show this help
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
11 --debug build with the debug code and switches, not as a release
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
12 "
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
13
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
14 DEBUG=0
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
15
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
16 while [ "$#" != 0 ]
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
17 do
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
18 case "$1" in
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
19 -h|--help) echo "$USAGE"; exit 0 ;;
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
20 --debug) DEBUG=1 ;;
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
21 *)
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
22 echo "unrecognized option '$1'" >&2
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
23 exit 1
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
24 ;;
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
25 esac
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
26 shift
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
27 done
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
28
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
29 # build.py and get_version.sh work on the repository root
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
30 cd "$(dirname "$0")/.." &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
31 if [ "$DEBUG" = 1 ]
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
32 then
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
33 python3 tools/build.py
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
34 else
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
35 python3 tools/build.py --release
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
36 fi &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
37 VERSION=$(tools/get_version.sh -f) &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
38 ARCHIVE="dist/minor_monsters_$VERSION.tar.gz" &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
39 mkdir -p dist &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
40 # www/ is stored as minor_monsters/
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
41 tar --no-xattrs --no-mac-metadata --exclude .DS_Store -s ',^www,minor_monsters,' \
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
42 -czf "$ARCHIVE" www &&
75deda08db90 game debug functions separated into own file; release build option, distribution script
ark
parents:
diff changeset
43 echo "wrote $ARCHIVE"