-
Notifications
You must be signed in to change notification settings - Fork 87
CLDR-18999 Allow the build script to push changes into the repo #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ name: build-json | |
|
|
||
| permissions: | ||
| packages: read | ||
| contents: write | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
@@ -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 | ||
|
|
@@ -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: | ||
|
|
@@ -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: | ||
|
|
@@ -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 | ||
|
|
@@ -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") | ||
| git push --verbose | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -26,6 +26,6 @@ MATCH='.*' | |||||
| DRAFTSTATUS="contributed" | ||||||
|
|
||||||
| # override the version number of CLDR | ||||||
| #VERSION="39.0.0" | ||||||
| VERSION="49.0.0-dev" | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert this. it's calculated.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| EXTRA_JSON_OPTS="" | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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)" | ||
|
|
||
There was a problem hiding this comment.
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 -