Skip to content

Commit 03710ab

Browse files
committed
Workflow renaming, mode → release phase, dist → TMP=pub/tmp
1 parent a4691eb commit 03710ab

File tree

2 files changed

+39
-38
lines changed

2 files changed

+39
-38
lines changed

.github/workflows/publish-data.sh

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# See publish-ucd.yml
1+
# See publish-data.yml
22

3-
mkdir dist
3+
TMP=pub/tmp
4+
mkdir $TMP
45

56
PUB_DATE=$(date --iso-8601)
67

7-
cat > dist/sed-readmes.txt << eof
8+
cat > $TMP/sed-readmes.txt << eof
89
s/COPY_YEAR/$COPY_YEAR/
910
s/PUB_DATE/$PUB_DATE/
1011
s/PUB_STATUS/draft/
@@ -15,43 +16,43 @@ s%PUBLIC_EMOJI%Public/draft/emoji%
1516
s%PUBLIC_UCD%Public/draft/UCD%
1617
eof
1718

18-
mkdir dist/UCD
19-
cp -R unicodetools/data/ucd/dev dist/UCD/ucd
20-
mv dist/UCD/ucd/version-ReadMe.txt dist/UCD/ReadMe.txt
21-
rm -r dist/UCD/ucd/Unihan
19+
mkdir $TMP/UCD
20+
cp -R unicodetools/data/ucd/dev $TMP/UCD/ucd
21+
mv $TMP/UCD/ucd/version-ReadMe.txt $TMP/UCD/ReadMe.txt
22+
rm -r $TMP/UCD/ucd/Unihan
2223

23-
if [ "$MODE" = "Snapshot" ]; then
24-
rm -r dist/UCD/ucd/emoji
24+
if [ "$RELEASE_PHASE" = "Dev" ]; then
25+
rm -r $TMP/UCD/ucd/emoji
2526
fi
2627

27-
if [ "$MODE" = "Alpha" ] || [ "$MODE" = "Beta" ]; then
28-
cp -R unicodetools/data/emoji/dev dist/emoji
28+
if [ "$RELEASE_PHASE" = "Alpha" ] || [ "$RELEASE_PHASE" = "Beta" ]; then
29+
cp -R unicodetools/data/emoji/dev $TMP/emoji
2930

30-
cp -R unicodetools/data/idna/dev dist/idna
31+
cp -R unicodetools/data/idna/dev $TMP/idna
3132

32-
mkdir dist/idna2008derived
33-
cp unicodetools/data/idna/idna2008derived/ReadMe.txt dist/idna2008derived
34-
cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt dist/idna2008derived
33+
mkdir $TMP/idna2008derived
34+
cp unicodetools/data/idna/idna2008derived/ReadMe.txt $TMP/idna2008derived
35+
cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt $TMP/idna2008derived
3536
fi
3637

37-
if [ "$MODE" = "Beta" ]; then
38-
cp -R unicodetools/data/uca/dev dist/UCA
39-
sed -i -f dist/sed-readmes.txt dist/UCA/CollationTest.html
38+
if [ "$RELEASE_PHASE" = "Beta" ]; then
39+
cp -R unicodetools/data/uca/dev $TMP/UCA
40+
sed -i -f $TMP/sed-readmes.txt $TMP/UCA/CollationTest.html
4041

41-
cp -R unicodetools/data/security/dev dist/security
42+
cp -R unicodetools/data/security/dev $TMP/security
4243
fi
4344

4445
# Update the readmes in-place (-i) as set up above.
45-
find dist -name '*ReadMe.txt' | xargs sed -i -f dist/sed-readmes.txt
46-
rm dist/sed-readmes.txt
46+
find $TMP -name '*ReadMe.txt' | xargs sed -i -f $TMP/sed-readmes.txt
47+
rm $TMP/sed-readmes.txt
4748

48-
mkdir dist/zipped
49-
mv dist/UCD/ucd/zipped-ReadMe.txt dist/zipped/ReadMe.txt
50-
(cd dist/UCD/ucd; zip -r UCD.zip *)
51-
mv dist/UCD/ucd/UCD.zip dist/zipped
49+
mkdir $TMP/zipped
50+
mv $TMP/UCD/ucd/zipped-ReadMe.txt $TMP/zipped/ReadMe.txt
51+
(cd $TMP/UCD/ucd; zip -r UCD.zip *)
52+
mv $TMP/UCD/ucd/UCD.zip $TMP/zipped
5253

53-
if [ "$MODE" = "Beta" ]; then
54-
(cd dist/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest)
54+
if [ "$RELEASE_PHASE" = "Beta" ]; then
55+
(cd $TMP/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest)
5556

56-
(cd dist/security; zip -r uts39-data-$UNI_VER.zip *)
57+
(cd $TMP/security; zip -r uts39-data-$UNI_VER.zip *)
5758
fi

.github/workflows/publish-data.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# See https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publication
22

33
# Test locally with https://github.com/nektos/act:
4-
# act --workflows .github/workflows/publish-ucd.yml --input mode=Alpha
4+
# act --workflows .github/workflows/publish-data.yml --input releasePhase=Alpha
55

6-
name: Publish UCD
6+
name: Publish Data
77

8-
run-name: "${{ github.workflow }}: ${{ inputs.mode }}"
8+
run-name: "${{ github.workflow }}: ${{ inputs.releasePhase }}"
99

1010
on:
1111
workflow_dispatch:
1212
inputs:
13-
mode:
14-
description: Publication mode
13+
releasePhase: # See ReleasePhase in https://github.com/unicode-org/unicodetools/blob/main/unicodetools/src/main/java/org/unicode/text/utility/Settings.java
14+
description: Release phase
1515
type: choice
1616
options:
17-
- Snapshot
17+
- Dev
1818
- Alpha
1919
- Beta
20-
default: Snapshot
20+
default: Dev
2121

2222
env:
2323
COPY_YEAR: "2024"
2424
UNI_VER: "17.0.0"
2525
EMOJI_VER: "17.0"
2626
TR10_REV: "tr10-52" # UTS #10 release revision number to be used in CollationTest.html: One more than the last release revision number.
27-
MODE: ${{ inputs.mode }}
27+
RELEASE_PHASE: ${{ inputs.releasePhase }}
2828

2929
jobs:
3030
build:
@@ -38,7 +38,7 @@ jobs:
3838
unicodetools/data/emoji/dev
3939
unicodetools/data/idna/dev
4040
unicodetools/data/idna/idna2008derived
41-
- run: .github/workflows/publish-ucd.sh
41+
- run: .github/workflows/publish-data.sh
4242
- uses: actions/upload-artifact@v4
4343
with:
44-
path: dist
44+
path: pub/tmp # See TMP in publish-data.sh

0 commit comments

Comments
 (0)