-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathbuild_release
executable file
·58 lines (44 loc) · 1.38 KB
/
build_release
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
57
58
#!/bin/sh
set -e
release_tag="${TRAVIS_TAG:-"$(git tag | tail -n 1)"}";
project_root="$(pwd)";
release_base_dir="$project_root/release";
release_all_name="SpoqaHanSans_all";
all_dir="$release_base_dir/$release_all_name";
mkdir -p "$release_base_dir";
mkdir -p "$all_dir";
cp LICENSE "$all_dir";
build_zip()
{
release_dirname="SpoqaHanSans_$1";
release_dir="$release_base_dir/$release_dirname";
echo "* release $release_dirname";
mkdir -p "$release_dir";
cp -r "$project_root/$2/"* "$release_dir/";
cp -r "$release_dir" "$all_dir";
cp LICENSE "$release_dir/";
cd "$release_base_dir";
zip "$release_dir.zip" -r "$release_dirname";
cd ..
rm -rf "$release_dir";
}
echo "Release $release_tag";
echo "~~~~~~~~~~~~~~~";
echo "${TRAVIS_REPO_SLUG:-"origin"}/${TRAVIS_BRANCH:-"master"}";
# git log from pre-released version to current version
# git log "$(git tag | tail -n 2 | head -n 1)"..."$release_tag" --pretty="format:%an <%ae> %s" --no-merges
echo "# Compress fonts...";
build_zip "original" \
"Original/SpoqaHanSans";
build_zip "jp_original" \
"Original/SpoqaHanSans_JP";
build_zip "subset" \
"Subset/SpoqaHanSans";
build_zip "jp_subset" \
"Subset/SpoqaHanSans_JP";
echo "* release $release_all_name";
cd "$release_base_dir";
zip "$release_all_name.zip" -r "$release_all_name";
rm -rf "$release_all_name";
cd ..
echo "release done.";