Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .github/workflows/build-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: build-json

permissions:
packages: read
contents: write

on:
workflow_dispatch:
Expand All @@ -11,7 +12,7 @@ on:
required: false
version:
description: Package Version (e.g. 46.0.0 or 46.0.0-BETA2 )
required: true
required: false
cldr-repo:
description: CLDR (tool) repo to use
required: true
Expand All @@ -32,6 +33,11 @@ on:
description: 'Path in Data repo'
required: false
default: 'production/'
push-changes:
description: 'Push changes to the cldr-json repo'
type: boolean
default: false
required: true

jobs:
build:
Expand All @@ -48,13 +54,15 @@ jobs:
with:
ref: ${{ github.event.inputs.git-ref }}
path: cldr-json
fetch-depth: 0
- name: Clone cldr
uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.cldr-ref }}
lfs: false
repository: ${{ github.event.inputs.cldr-repo }}
path: cldr
fetch-depth: 0
- name: Cache local Maven repository
uses: actions/cache@v4
with:
Expand All @@ -71,12 +79,12 @@ jobs:
repository: ${{ github.event.inputs.data-repo }}
sparse-checkout: ${{ github.event.inputs.data-dir }}
path: cldr-staging
fetch-depth: 0
- name: Setup Config
working-directory: cldr-json
run: |
echo VERSION=${{ github.event.inputs.version }} > local-config.sh
cat local-config.sh
chmod a+rx local-config.sh
[ -n "${{ github.event.inputs.version }}" ] && echo VERSION=${{ github.event.inputs.version }} > local-config.sh
chmod +x local-config.sh || true
bash cldr-identify.sh | tee ../cldr-identity.txt
- name: Upload cldr-identity.txt
uses: actions/upload-artifact@v4
Expand All @@ -103,6 +111,15 @@ jobs:
with:
name: cldr-json
path: ./cldr-json/dist
- name: Push changes
if: ${{ github.event.inputs.push-changes }}
working-directory: cldr-json
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add cldr-json
git commit --verbose -F - < (echo "Automated update; echo; cat ../cldr-identity.txt")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line isn't quite right, too many levels of quotes. it will result in a commit message Automated update; echo; cat..

I think the first line could give a little more details as well.

Probably instead something like

( echo ... ) | git commit ... -F -

git push --verbose



2 changes: 1 addition & 1 deletion cldr-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ MATCH='.*'
DRAFTSTATUS="contributed"

# override the version number of CLDR
#VERSION="39.0.0"
VERSION="49.0.0-dev"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please revert this. it's calculated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
VERSION="49.0.0-dev"
#VERSION="39.0.0"


EXTRA_JSON_OPTS=""
3 changes: 2 additions & 1 deletion cldr-generate-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ then
${MVN} exec:java -Dexec.mainClass=org.unicode.cldr.tool.GenerateProductionData -DCLDR_DIR=${CLDR_DIR} -Dexec.args="-d ${INDATA}/common"
fi

mkdir -p ${OUT}
# for now, seed has to exist.
mkdir -p -v ${OUT} ${INDATA}/seed/main ${INDATA}/seed/annotations ${DIST}
mkdir -p -v ${INDATA}/seed/{main,annotations}

for type in ${TYPES}; do
${MVN} exec:java -Dexec.mainClass=org.unicode.cldr.json.Ldml2JsonConverter -DCLDR_DIR=${INDATA} -Dexec.args="-m ${MATCH} -p true -o true -r true -t ${type} -d ${OUT} -s ${DRAFTSTATUS} -V ${VERSION} ${EXTRA_JSON_OPTS}"
Expand Down
17 changes: 6 additions & 11 deletions cldr-generate-zip.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ then
. ./local-config.sh
fi

if [[ -z "$VERSION" ]];
then
echo "VERSION is undefined, exiting from $0"
exit 1
fi
VERSION="$(jq -r .version cldr-json/cldr-core/package.json)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

DIST=$(pwd)/${DIST}

set -x
( cd ${OUT} && cp ../LICENSE LICENSE )
( cd ${OUT} && zip -x "*/.DS_Store" -r cldr-${VERSION}-json-full.zip LICENSE cldr-core cldr-rbnf cldr-*-full cldr-bcp47 cldr-transforms )
#( cd ${OUT} && zip -r cldr-${VERSION}-json-modern.zip LICENSE cldr-core cldr-rbnf cldr-*-modern cldr-bcp47 cldr-transforms )
( cd ${OUT} && rm LICENSE )

mv -v ${OUT}/*.zip ${DIST}/
mkdir -p ${DIST}
cp LICENSE ${OUT}/LICENSE
( cd ${OUT} && zip -x "*/.DS_Store" -r ${DIST}/cldr-${VERSION}-json-full.zip * )
rm ${OUT}/LICENSE
3 changes: 1 addition & 2 deletions cldr-identify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ fi
function explain_repo()
{
git remote get-url origin | sed -E 's/[email protected]:|https:\/\/github.com\/|.git//g'
git describe --tags HEAD
git describe --tags --always HEAD
}

echo "* cldr-json info"
if [[ "$INDATA" == "generate" ]]
then
echo "- DATA: " $(cd ${CLDR_DIR}; explain_repo) "(generated)"
Expand Down