Skip to content

Commit f85bd3f

Browse files
committed
Workflow for publishing UCD
Basic separation of input/ouput: - $1 and $2 are now static because the workflow is run in an isolated environment and the cwd is always the repo root. - Set dynamic inputs in the workflow as env variables. - Upload built files as a workflow artifact. Git doesn’t preserve complete file permissions, and the zipping/unzipping process doesn’t reliably preserve file permissions. Therefore file permissions need to be normalized at deployment site. The “Copy files from elsewhere” note needs to be documented in data-workflow.md#publication.
1 parent f930b35 commit f85bd3f

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
# Script for
2-
# https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publish-a-ucd-snapshot
3-
#
4-
# Invoke like this:
5-
#
6-
# pub/copy-ucd-to-draft.sh ~/unitools/mine/src /tmp/unicode/Public/draft
1+
# See publish-ucd.yml
72

8-
UNICODETOOLS=$1
9-
DRAFT=$2
10-
11-
UNITOOLS_DATA=$UNICODETOOLS/unicodetools/data
12-
13-
# Adjust the following for each year and version as needed.
14-
COPY_YEAR=2024
15-
UNI_VER=17.0.0
16-
EMOJI_VER=17.0
3+
UNITOOLS_DATA=unicodetools/data
4+
DRAFT=dist
175

186
TODAY=`date --iso-8601`
197

@@ -37,9 +25,6 @@ rm -r $DRAFT/UCD/ucd/emoji
3725
mv $DRAFT/UCD/ucd/version-ReadMe.txt $DRAFT/UCD/ReadMe.txt
3826
mv $DRAFT/UCD/ucd/zipped-ReadMe.txt $DRAFT/zipped/ReadMe.txt
3927

40-
# Fix permissions. Everyone can read, and search directories.
41-
chmod a+rX -R $DRAFT
42-
4328
# Update the readmes in-place (-i) as set up above.
4429
find $DRAFT -name '*ReadMe.txt' | xargs sed -i -f $DRAFT/sed-readmes.txt
4530

@@ -49,12 +34,3 @@ rm $DRAFT/UCD/ucd/UCD.zip
4934

5035
# Cleanup
5136
rm $DRAFT/sed-readmes.txt
52-
53-
rm $DRAFT/ucd-snapshot.zip
54-
(cd $DRAFT; zip -r ucd-snapshot.zip *)
55-
56-
echo "--------------------"
57-
echo "Copy files from elsewhere:"
58-
echo "- Unihan.zip to $DRAFT/UCD/ucd"
59-
echo "- Unihan.zip to $DRAFT/zipped"
60-

.github/workflows/publish-ucd.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publication
2+
3+
# Test locally with https://github.com/nektos/act: act --workflows .github/workflows/publish-ucd.yml
4+
5+
name: Publish UCD
6+
7+
on:
8+
workflow_dispatch:
9+
10+
env:
11+
COPY_YEAR: "2024"
12+
UNI_VER: "17.0.0"
13+
EMOJI_VER: "17.0"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- run: .github/workflows/publish-ucd.sh
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
path: dist

0 commit comments

Comments
 (0)