-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakeRelease.sh
53 lines (43 loc) · 1.39 KB
/
MakeRelease.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
#!/bin/bash
# --------------------------------------------------------------------------
# DelphiDabbler Code Snippets Database v2
#
# Build tool for Windows to package up files ready for release.
#
# This file is licensed under the MIT license, copyright © 2020-2023 Peter
# Johnson, https://gravatar.com/delphidabbler
#
#
# Three packages are made, each in a zip file: one containing the
# collection, another containing documentation and a third containing tests.
# All zip files are written to the _release sub-folder in the collection's
# home directory.
#
# Any pre-existing _release sub-folder is cleared before the zip files are
# created.
#
# Requirements:
#
# - The release version number must be passed to this script as a command
# line parameter.
#
# - The zip utility program is required to zip up the files.
#
# --------------------------------------------------------------------------
VERSION=$1
RELEASE_DIR="./_release"
RELEASE_FILE_STUB="${RELEASE_DIR}/csdb-v${VERSION}"
COLLECTION_ZIP_FILE="${RELEASE_FILE_STUB}-data.zip"
DOCS_ZIP_FILE="${RELEASE_FILE_STUB}-docs.zip"
TESTS_ZIP_FILE="${RELEASE_FILE_STUB}-tests.zip"
echo Creating CSDB release $1
echo
rm -rf $RELEASE_DIR || true
mkdir $RELEASE_DIR
echo Zipping data
zip -j -q $COLLECTION_ZIP_FILE ./collection/*
echo Zipping documentation
zip -j -q $DOCS_ZIP_FILE ./docs/*
echo Zipping tests
zip -q -r $TESTS_ZIP_FILE ./tests/*
echo Done