From 67f924ff4cb0e71255a3fe26a3d1b3f471fd37a0 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Sep 2025 11:36:07 -0500 Subject: [PATCH 1/2] CLDR-18999 auto generate production data if data ref is GENERATE --- .github/workflows/build-json.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 8043d951b2..d449f62fb6 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -1,5 +1,8 @@ name: build-json +permissions: + packages: read + on: workflow_dispatch: inputs: @@ -22,7 +25,7 @@ on: required: true default: 'unicode-org/cldr-staging' data-ref: - description: 'Data (staging) ref/tag/branch to use' + description: 'Data (staging) ref/tag/branch to use (if "GENERATE", generate production data)' required: true default: 'main' data-dir: @@ -61,11 +64,25 @@ jobs: ${{ runner.os }}-maven- - name: Clone Data uses: actions/checkout@v5 + if: github.event.inputs.data-ref != 'GENERATE' with: ref: ${{ github.event.inputs.data-ref }} repository: ${{ github.event.inputs.data-repo }} sparse-checkout: ${{ github.event.inputs.data-dir }} path: cldr-staging + - name: Generate Production + if: github.event.inputs.data-ref == 'GENERATE' + run: | + cd cldr + mkdir -p ../cldr-staging/${{ github.event.inputs.data-dir }} + echo "::group::Build cldr-code" + mvn -s ../cldr/.github/workflows/mvn-settings.xml -B compile install package -DskipTests=true --file=tools/pom.xml -pl cldr-code + echo "::endgroup::" + echo "::group::GenerateProductionData" + mvn -s ../cldr/.github/workflows/mvn-settings.xml -B -DCLDR_DIR=$(pwd) -DCLDR_GITHUB_ANNOTATIONS=true --file=tools/pom.xml -pl cldr-code exec:java -Dexec.mainClass=org.unicode.cldr.tool.GenerateProductionData + echo "::endgroup::" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup Config run: | cd cldr-json @@ -87,7 +104,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="-B -s ../cldr/.github/workflows/mvn-settings.xml" bash ./cldr-generate-json.sh echo "::endgroup::" echo "::group::Status" git status || true From e70e7ae7cbaac47c1622c0b7a8266b516ab0675f Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Sat, 4 Oct 2025 10:58:46 -0500 Subject: [PATCH 2/2] CLDR-18999 build-json typo fix --- .github/workflows/build-json.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 289ebe3ac3..42dd32da9b 100644 --- a/.github/workflows/build-json.yml +++ b/.github/workflows/build-json.yml @@ -21,11 +21,11 @@ on: required: true default: 'main' data-repo: - description: Data (staging) repo to use + description: 'Data (staging) repo to use (if "GENERATE", generate production data)' required: true default: 'unicode-org/cldr-staging' data-ref: - description: 'Data (staging) ref/tag/branch to use (if "GENERATE", generate production data)' + description: 'Data (staging) ref/tag/branch to use' required: true default: 'main' data-dir: @@ -73,7 +73,7 @@ jobs: sparse-checkout: ${{ github.event.inputs.data-dir }} path: cldr-staging - name: Generate Production - if: github.event.inputs.data-ref == 'GENERATE' + if: github.event.inputs.data-repo == 'GENERATE' run: | cd cldr mkdir -p ../cldr-staging/${{ github.event.inputs.data-dir }}