forked from boost-starai/BoostSRL-Misc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zip_artifacts.sh
42 lines (32 loc) · 913 Bytes
/
zip_artifacts.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
#!/usr/bin/env bash
# Copyright © Alexander L. Hayes
# MIT License
# SYNOPSIS: Create zip artifacts of datasets for distribution.
# OVERVIEW: This assumes that data sets follow the pattern:
# `srlearn/name/name/`
#
# All zipped copies will be placed in the `build/` directory at the
# base of the repository.
echo "Creating build directory"
rm -rf build
mkdir build
# Zipfiles contain the name of the dataset and the release version
# (e.g. v0.1.0). This should be set prior to running, either with:
# `export RELEASE_VERSION=v0.1.0`, or automatically using the tag
# in GitHub Actions.
if [[ -z ${RELEASE_VERSION} ]]; then
echo "Error. RELEASE_VERSION not set." 1>&2
exit 2
fi
(
cd srlearn/
for ds in *; do
if [[ $ds != "README.md" ]]; then
(
echo "Zipping $ds"
cd $ds
zip -r ../../build/${ds}_${RELEASE_VERSION}.zip ${ds}
)
fi
done
)