Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow: Publish Data #980

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
48 changes: 29 additions & 19 deletions .github/workflows/publish-ucd.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
# See publish-ucd.yml

TODAY=`date --iso-8601`

mkdir dist

PUB_DATE=$(date --iso-8601)

cat > dist/sed-readmes.txt << eof
s/COPY_YEAR/$COPY_YEAR/
s/PUB_DATE/$TODAY/
s/PUB_DATE/$PUB_DATE/
s/PUB_STATUS/draft/
s/UNI_VER/$UNI_VER/
s/EMOJI_VER/$EMOJI_VER/
s/TR10_REV/$TR10_REV/
s%PUBLIC_EMOJI%Public/draft/emoji%
s%PUBLIC_UCD%Public/draft/UCD%
eof

mkdir -p dist/UCD/ucd
mkdir dist/zipped
cp -r unicodetools/data/ucd/dev/* dist/UCD/ucd
rm -r dist/UCD/ucd/Unihan
mkdir dist/UCD
cp -R unicodetools/data/ucd/dev dist/UCD/ucd
mv dist/UCD/ucd/version-ReadMe.txt dist/UCD/ReadMe.txt
mv dist/UCD/ucd/zipped-ReadMe.txt dist/zipped/ReadMe.txt
rm -r dist/UCD/ucd/Unihan
if [ "$MODE" = "Snapshot" ]; then
rm -r dist/UCD/ucd/emoji
fi

if [ $MODE = "Alpha" ]; then
mkdir dist/emoji
cp unicodetools/data/emoji/dev/* dist/emoji
if [ "$MODE" = "Alpha" ] || [ "$MODE" = "Beta" ]; then
cp -R unicodetools/data/emoji/dev dist/emoji

mkdir dist/idna
cp unicodetools/data/idna/dev/* dist/idna
cp -R unicodetools/data/idna/dev dist/idna

mkdir dist/idna2008derived
cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt dist/idna2008derived
cp unicodetools/data/idna/idna2008derived/ReadMe.txt dist/idna2008derived
else
rm -r dist/UCD/ucd/emoji
cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt dist/idna2008derived

if [ "$MODE" = "Beta" ]; then
lianghai marked this conversation as resolved.
Show resolved Hide resolved
cp -R unicodetools/data/uca/dev dist/UCA
sed -i -f dist/sed-readmes.txt dist/UCA/CollationTest.html

cp -R unicodetools/data/security/dev dist/security
fi
fi

# Update the readmes in-place (-i) as set up above.
find dist -name '*ReadMe.txt' | xargs sed -i -f dist/sed-readmes.txt
rm dist/sed-readmes.txt

# Zip files for some types of data, after fixing permissions
mkdir dist/zipped
mv dist/UCD/ucd/zipped-ReadMe.txt dist/zipped/ReadMe.txt
(cd dist/UCD/ucd; zip -r UCD.zip *)
mv dist/UCD/ucd/UCD.zip dist/zipped

# Cleanup
rm dist/sed-readmes.txt
if [ "$MODE" = "Beta" ]; then
(cd dist/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest)

(cd dist/security; zip -r uts39-data-$UNI_VER.zip *)
fi
2 changes: 2 additions & 0 deletions .github/workflows/publish-ucd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ on:
options:
- Snapshot
- Alpha
- Beta
default: Snapshot

env:
COPY_YEAR: "2024"
UNI_VER: "17.0.0"
EMOJI_VER: "17.0"
TR10_REV: "tr10-52" # UTS #10 release revision number to be used in CollationTest.html: One more than the last release revision number.
MODE: ${{ inputs.mode }}

jobs:
Expand Down
93 changes: 0 additions & 93 deletions pub/copy-beta-to-draft.sh

This file was deleted.

Loading