-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
release.sh
executable file
·41 lines (29 loc) · 1.05 KB
/
release.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
#!/usr/bin/env bash
# Fail on unset variables and command errors
set -ue -o pipefail
TAG_NAME="$1"
RELEASE_ASSETS_DIR="build"
RELEASE_NOTES="release_notes.md"
rm -rf "${RELEASE_ASSETS_DIR}" || true
mkdir "${RELEASE_ASSETS_DIR}"
cat $(echo ./tsv/*.tsv) > "./${RELEASE_ASSETS_DIR}/emoji.txt"
(
cd "${RELEASE_ASSETS_DIR}"
zip ./emoji.zip ./emoji.txt
# Microsoft IME (Windows)
nkf -w16L -Lw ./emoji.txt > ./emoji.windows.txt
zip ./emoji.windows.zip ./emoji.windows.txt
# ATOK for Windows
sed -e 's/記号/顔文字*/g' ./emoji.windows.txt > ./emoji.atok-windows.txt
zip ./emoji.atok-windows.zip ./emoji.atok-windows.txt
# ATOK for Mac (macOS)
sed -e 's/記号/顔文字*/g' ./emoji.txt > ./emoji.atok-macos.txt
nkf --overwrite -w16L ./emoji.atok-macos.txt
zip ./emoji.atok-macos.zip ./emoji.atok-macos.txt
rm ./*.txt
)
sed -i "1i日本語 IME 絵文字拡張辞書 ${TAG_NAME}\n" "./${RELEASE_NOTES}"
gh release delete --yes "${TAG_NAME}"
gh release create "${TAG_NAME}" \
--notes-file "./${RELEASE_NOTES}" \
"${RELEASE_ASSETS_DIR}"/*