From 03710abf32bd42a97f8ea15fddaee4ba4feabc29 Mon Sep 17 00:00:00 2001 From: Liang Hai Date: Thu, 12 Dec 2024 17:31:22 +0100 Subject: [PATCH] =?UTF-8?q?Workflow=20renaming,=20mode=20=E2=86=92=20relea?= =?UTF-8?q?se=20phase,=20=20dist=20=E2=86=92=20TMP=3Dpub/tmp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-data.sh | 57 +++++++++++++++--------------- .github/workflows/publish-data.yml | 20 +++++------ 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/.github/workflows/publish-data.sh b/.github/workflows/publish-data.sh index 90f992d9b..02d0beacc 100755 --- a/.github/workflows/publish-data.sh +++ b/.github/workflows/publish-data.sh @@ -1,10 +1,11 @@ -# See publish-ucd.yml +# See publish-data.yml -mkdir dist +TMP=pub/tmp +mkdir $TMP PUB_DATE=$(date --iso-8601) -cat > dist/sed-readmes.txt << eof +cat > $TMP/sed-readmes.txt << eof s/COPY_YEAR/$COPY_YEAR/ s/PUB_DATE/$PUB_DATE/ s/PUB_STATUS/draft/ @@ -15,43 +16,43 @@ 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 +mkdir $TMP/UCD +cp -R unicodetools/data/ucd/dev $TMP/UCD/ucd +mv $TMP/UCD/ucd/version-ReadMe.txt $TMP/UCD/ReadMe.txt +rm -r $TMP/UCD/ucd/Unihan -if [ "$MODE" = "Snapshot" ]; then - rm -r dist/UCD/ucd/emoji +if [ "$RELEASE_PHASE" = "Dev" ]; then + rm -r $TMP/UCD/ucd/emoji fi -if [ "$MODE" = "Alpha" ] || [ "$MODE" = "Beta" ]; then - cp -R unicodetools/data/emoji/dev dist/emoji +if [ "$RELEASE_PHASE" = "Alpha" ] || [ "$RELEASE_PHASE" = "Beta" ]; then + cp -R unicodetools/data/emoji/dev $TMP/emoji - cp -R unicodetools/data/idna/dev dist/idna + cp -R unicodetools/data/idna/dev $TMP/idna - mkdir dist/idna2008derived - cp unicodetools/data/idna/idna2008derived/ReadMe.txt dist/idna2008derived - cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt dist/idna2008derived + mkdir $TMP/idna2008derived + cp unicodetools/data/idna/idna2008derived/ReadMe.txt $TMP/idna2008derived + cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt $TMP/idna2008derived fi -if [ "$MODE" = "Beta" ]; then - cp -R unicodetools/data/uca/dev dist/UCA - sed -i -f dist/sed-readmes.txt dist/UCA/CollationTest.html +if [ "$RELEASE_PHASE" = "Beta" ]; then + cp -R unicodetools/data/uca/dev $TMP/UCA + sed -i -f $TMP/sed-readmes.txt $TMP/UCA/CollationTest.html - cp -R unicodetools/data/security/dev dist/security + cp -R unicodetools/data/security/dev $TMP/security 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 +find $TMP -name '*ReadMe.txt' | xargs sed -i -f $TMP/sed-readmes.txt +rm $TMP/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 +mkdir $TMP/zipped +mv $TMP/UCD/ucd/zipped-ReadMe.txt $TMP/zipped/ReadMe.txt +(cd $TMP/UCD/ucd; zip -r UCD.zip *) +mv $TMP/UCD/ucd/UCD.zip $TMP/zipped -if [ "$MODE" = "Beta" ]; then - (cd dist/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest) +if [ "$RELEASE_PHASE" = "Beta" ]; then + (cd $TMP/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest) - (cd dist/security; zip -r uts39-data-$UNI_VER.zip *) + (cd $TMP/security; zip -r uts39-data-$UNI_VER.zip *) fi diff --git a/.github/workflows/publish-data.yml b/.github/workflows/publish-data.yml index e576f6df9..aeab2408c 100644 --- a/.github/workflows/publish-data.yml +++ b/.github/workflows/publish-data.yml @@ -1,30 +1,30 @@ # 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 +# act --workflows .github/workflows/publish-data.yml --input releasePhase=Alpha -name: Publish UCD +name: Publish Data -run-name: "${{ github.workflow }}: ${{ inputs.mode }}" +run-name: "${{ github.workflow }}: ${{ inputs.releasePhase }}" on: workflow_dispatch: inputs: - mode: - description: Publication mode + releasePhase: # See ReleasePhase in https://github.com/unicode-org/unicodetools/blob/main/unicodetools/src/main/java/org/unicode/text/utility/Settings.java + description: Release phase type: choice options: - - Snapshot + - Dev - Alpha - Beta - default: Snapshot + default: Dev 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 }} + RELEASE_PHASE: ${{ inputs.releasePhase }} jobs: build: @@ -38,7 +38,7 @@ jobs: unicodetools/data/emoji/dev unicodetools/data/idna/dev unicodetools/data/idna/idna2008derived - - run: .github/workflows/publish-ucd.sh + - run: .github/workflows/publish-data.sh - uses: actions/upload-artifact@v4 with: - path: dist + path: pub/tmp # See TMP in publish-data.sh