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
56 changes: 56 additions & 0 deletions .github/workflows/publish-ucd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# See publish-ucd.yml

mkdir dist

PUB_DATE=$(date --iso-8601)

cat > dist/sed-readmes.txt << eof
s/COPY_YEAR/$COPY_YEAR/
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 dist/UCD
cp -R unicodetools/data/ucd/dev dist/UCD/ucd
mv dist/UCD/ucd/version-ReadMe.txt dist/UCD/ReadMe.txt
rm -r dist/UCD/ucd/Unihan
if [ "$MODE" = "Snapshot" ]; then
rm -r dist/UCD/ucd/emoji
fi

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

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

mkdir dist/idna2008derived
cp unicodetools/data/idna/idna2008derived/ReadMe.txt dist/idna2008derived
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

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

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
44 changes: 44 additions & 0 deletions .github/workflows/publish-ucd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# See https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publication

# Test locally with https://github.com/nektos/act:
# act --workflows .github/workflows/publish-ucd.yml --input mode=Alpha

name: Publish UCD

run-name: "${{ github.workflow }}: ${{ inputs.mode }}"

on:
workflow_dispatch:
inputs:
mode:
description: Publication mode
type: choice
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:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows
unicodetools/data/ucd/dev
unicodetools/data/emoji/dev
unicodetools/data/idna/dev
unicodetools/data/idna/idna2008derived
- run: .github/workflows/publish-ucd.sh
- uses: actions/upload-artifact@v4
with:
path: dist
71 changes: 0 additions & 71 deletions pub/copy-alpha-to-draft.sh

This file was deleted.

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

This file was deleted.

60 changes: 0 additions & 60 deletions pub/copy-ucd-to-draft.sh

This file was deleted.

Loading