diff --git a/.github/workflows/build-json.yml b/.github/workflows/build-json.yml index 82acec54b1..42dd32da9b 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: @@ -18,7 +21,7 @@ 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: @@ -61,12 +64,27 @@ jobs: ${{ runner.os }}-maven- - name: Clone Data uses: actions/checkout@v5 - if: ${{ github.event.inputs.data-repo != 'generate' }} + # 'GENERATE' will generate here, in the action. + # 'generate' will generate in the build script, currently broken. + if: ${{ github.event.inputs.data-repo != 'GENERATE' && github.event.inputs.data-repo != '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-repo == '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 @@ -86,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