From 90c46961d8a373d1f88d8cfc9386231818c871bc Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Sat, 31 Aug 2024 19:03:40 -0500 Subject: [PATCH 01/10] CLDR-17918 Update README.md https://github.com/unicode-org/.github/issues/17 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e9f080bb45c..cba0f7f2742 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,6 @@ the data contained here, please file a new ticket at [Unicode Jira](https://unic Copyright © 2015-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries. -The project is released under [LICENSE](./LICENSE). +A CLA is required to contribute to this project - please refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file (or start a Pull Request) for more information. -A CLA is required to contribute to this project - please refer to the [CONTRIBUTING.md](https://github.com/unicode-org/.github/blob/main/.github/CONTRIBUTING.md) file (or start a Pull Request) for more information. +The contents of this repository are governed by the Unicode [Terms of Use](https://www.unicode.org/copyright.html) and are released under [LICENSE](./LICENSE). From 1fd5dbe9abf875e8475838c7fc0ca6d7993606d5 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 08:38:20 -0500 Subject: [PATCH 02/10] CLDR-17918 workflow for building cldr-json --- .github/dependabot.yml | 14 ++++++++ .github/workflows/build-json.yml | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build-json.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..f1bbbc29c62 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + commit-message: + include: scope + prefix: "CLDR-00000 deps" diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml new file mode 100644 index 00000000000..e46919aef77 --- /dev/null +++ b/.github/workflows/build-json.yml @@ -0,0 +1,62 @@ +name: build-json + +on: + workflow_dispatch: + inputs: + git-ref: + description: Git Ref to build (Optional) + required: false + version: + description: Package Version (e.g. 46.0.0 or 46.0.0-BETA2 ) + required: true + cldr-repo: + description: CLDR (tool) repo to use + required: true + default: 'unicode-org/cldr' + cldr-ref: + description: 'CLDR (tool) ref/tag/branch to use' + required: true + default: 'main' + data-repo: + description: Data (staging) repo to use + required: true + default: 'unicode-org/cldr-staging' + data-ref: + description: 'Data (staging) ref/tag/branch to use' + required: true + default: 'main' + data-dir: + description: 'Path in Data repo' + required: true + default: 'production/' + +jobs: + build: + name: Build cldr-json + runs-on: ubuntu-latest + steps: + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: 11 + distribution: 'temurin' + - name: Clone json + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.git-ref }} + path: cldr-json + - name: Clone CLDR + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.cldr-ref }} + lfs: false + repository: ${{ github.event.inputs.cldr-repo }} + path: cldr + - name: Clone Data + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.data-ref }} + repository: ${{ github.event.inputs.data-repo }} + sparse-checkout: ${{ github.event.inputs.data-dir }} + path: cldr-staging + From 5833e93b3e034f5d386c605074ecd27fb910487d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 08:47:18 -0500 Subject: [PATCH 03/10] CLDR-17918 build: add identity --- .github/workflows/build-json.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index e46919aef77..821291ebff2 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -52,6 +52,13 @@ jobs: lfs: false repository: ${{ github.event.inputs.cldr-repo }} path: cldr + - name: Cache local Maven repository + uses: actions/cache@v4 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('cldr/tools/**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: Clone Data uses: actions/checkout@v4 with: @@ -59,4 +66,18 @@ jobs: repository: ${{ github.event.inputs.data-repo }} sparse-checkout: ${{ github.event.inputs.data-dir }} path: cldr-staging + - name: Setup Config + run: | + cd cldr-json + echo VERSION=${{ github.event.inputs.version }} > local-config.sh + echo CLDR_DIR=../cldr >> local-config.sh + echo INDATA=../cldr-staging/${{ github.event.inputs.data-dir }} >> local-config.sh + cat local-config.sh + bash cldr-identify.sh | tee ../cldr-identity.txt + - name: Upload cldr-identity.txt + uses: actions/upload-artifact@v4 + with: + name: cldr-identity + path: ./cldr-identity.txt + From 399498d0eaad216cf4f2252db372227e6382f4cf Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 08:54:20 -0500 Subject: [PATCH 04/10] CLDR-17918 build: actual build --- .github/workflows/build-json.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 821291ebff2..13ad66b5ee0 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -79,5 +79,32 @@ jobs: with: name: cldr-identity path: ./cldr-identity.txt + - name: Build JSON + run: | + cd cldr-json + echo "::group::Cleanup" + rm -rf cldr-json + echo "::endgroup::" + echo "::group::Build" + bash cldr-generate-json.sh + echo "::endgroup::" + echo "::group::Status" + git status || true + echo "::endgroup::" + echo "::group::Zip" + bash cldr-generate-zip.sh + cp PACKAGES.md dist/ + echo "::endgroup::" + - name: Upload dist + uses: actions/upload-artifact@v4 + with: + name: cldr-json + path: ./cldr-json/dist + - name: Upload dist + uses: actions/upload-artifact@v4 + with: + name: cldr-json + path: ./cldr-json/dist + From fa27243f5cbf4305d9a157045aa4dc719caa5afe Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 08:57:43 -0500 Subject: [PATCH 05/10] CLDR-17918 build: just one dist upload --- .github/workflows/build-json.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 13ad66b5ee0..5ae5c98de95 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -100,11 +100,6 @@ jobs: with: name: cldr-json path: ./cldr-json/dist - - name: Upload dist - uses: actions/upload-artifact@v4 - with: - name: cldr-json - path: ./cldr-json/dist From 37244e8d91de28fa22c7e1963d0cee319715044b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 09:03:10 -0500 Subject: [PATCH 06/10] CLDR-17918 build: fix script --- .github/workflows/build-json.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 5ae5c98de95..5fd029268d4 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -73,6 +73,7 @@ jobs: echo CLDR_DIR=../cldr >> local-config.sh echo INDATA=../cldr-staging/${{ github.event.inputs.data-dir }} >> local-config.sh cat local-config.sh + chmod a+rx local-config.sh bash cldr-identify.sh | tee ../cldr-identity.txt - name: Upload cldr-identity.txt uses: actions/upload-artifact@v4 From b9b1a24a96b373d0a41c5d974d944815468fe7de Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 09:19:17 -0500 Subject: [PATCH 07/10] CLDR-17918 build: don't forget that maven token - needed for pulling ICU down --- .github/workflows/build-json.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 5fd029268d4..f82a3300e65 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -96,6 +96,8 @@ jobs: bash cldr-generate-zip.sh cp PACKAGES.md dist/ echo "::endgroup::" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload dist uses: actions/upload-artifact@v4 with: From f9b1162192b7173b9e9cf2bc0d1debe872ce7d97 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 11:05:59 -0500 Subject: [PATCH 08/10] CLDR-17918 build: use mvn settings from CLDR - piggyback on cldr/.github/workflows/mvn-settings.xml for building - add MVN_OPTS variable in the json build script --- .github/workflows/build-json.yml | 2 +- cldr-generate-json.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index f82a3300e65..36de8817c15 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -87,7 +87,7 @@ jobs: rm -rf cldr-json echo "::endgroup::" echo "::group::Build" - bash cldr-generate-json.sh + bash MVN_OPTS="-s cldr/.github/workflows/mvn-settings.xml" cldr-generate-json.sh echo "::endgroup::" echo "::group::Status" git status || true diff --git a/cldr-generate-json.sh b/cldr-generate-json.sh index c33796bc6fb..109910ab29d 100644 --- a/cldr-generate-json.sh +++ b/cldr-generate-json.sh @@ -22,7 +22,7 @@ fi mkdir -p -v ${OUT} ${INDATA}/seed/main ${INDATA}/seed/annotations ${DIST} MAIN_CLASS=org.unicode.cldr.json.Ldml2JsonConverter export MAVEN_OPTS="-Xmx16384m -Dexec.cleanupDaemonThreads=false -Dexec.mainClass=${MAIN_CLASS}" -MVN="mvn --file=${CLDR_DIR}/tools/pom.xml -pl cldr-code" +MVN="mvn ${MVN_OPTS} --file=${CLDR_DIR}/tools/pom.xml -pl cldr-code" MVN_COMPILE="${MVN} compile" MVN_EXEC="${MVN} -DCLDR_DIR=${INDATA} exec:java" From ceab876e5a55a724085fc99394e6028957db4d60 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 11:40:24 -0500 Subject: [PATCH 09/10] CLDR-17918 build: use mvn settings from CLDR - fix MVN_OPTS variable in the json build script --- .github/workflows/build-json.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 36de8817c15..3a272ec2fbf 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -87,7 +87,7 @@ jobs: rm -rf cldr-json echo "::endgroup::" echo "::group::Build" - bash MVN_OPTS="-s cldr/.github/workflows/mvn-settings.xml" cldr-generate-json.sh + env MVN_OPTS="-s cldr/.github/workflows/mvn-settings.xml" bash ./cldr-generate-json.sh echo "::endgroup::" echo "::group::Status" git status || true From 1c214638cd5bbbc37edafad0b9595085087dd117 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 23 Oct 2024 11:48:10 -0500 Subject: [PATCH 10/10] CLDR-17918 build: use mvn settings from CLDR - going dotty --- .github/workflows/build-json.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 3a272ec2fbf..8d347b0b5c1 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -87,7 +87,7 @@ jobs: rm -rf cldr-json echo "::endgroup::" echo "::group::Build" - env MVN_OPTS="-s cldr/.github/workflows/mvn-settings.xml" bash ./cldr-generate-json.sh + env MVN_OPTS="-s ../cldr/.github/workflows/mvn-settings.xml" bash ./cldr-generate-json.sh echo "::endgroup::" echo "::group::Status" git status || true