Skip to content

Commit eaeb87a

Browse files
chore: manual update of update_generation_config.sh (#1897)
* chore: manual update of update_generation_config.sh * chore: generate libraries at Thu Jul 24 18:25:25 UTC 2025 * chore: restore changes * chore: generate libraries at Thu Jul 24 18:31:08 UTC 2025 * Revert "chore: generate libraries at Thu Jul 24 18:31:08 UTC 2025" This reverts commit bf24825. --------- Co-authored-by: cloud-java-bot <[email protected]>
1 parent b613551 commit eaeb87a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

.github/scripts/update_generation_config.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33
# This script should be run at the root of the repository.
44
# This script is used to update googleapis_commitish, gapic_generator_version,
55
# and libraries_bom_version in generation configuration at the time of running
@@ -15,8 +15,10 @@ set -e
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
json_content=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json")
19-
latest=$(jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' <<< "${json_content}" | sort -V | tail -n 1)
18+
group_id_url_path="$(sed 's|\.|/|g' <<< "${group_id}")"
19+
url="https://repo1.maven.org/maven2/${group_id_url_path}/${artifact_id}/maven-metadata.xml"
20+
xml_content=$(curl -s --fail "${url}")
21+
latest=$(xmllint --xpath 'metadata/versioning/latest/text()' - <<< "${xml_content}")
2022
if [[ -z "${latest}" ]]; then
2123
echo "The latest version of ${group_id}:${artifact_id} is empty."
2224
echo "The returned json from maven.org is invalid: ${json_content}"
@@ -172,4 +174,4 @@ if [ -z "${pr_num}" ]; then
172174
else
173175
git push
174176
gh pr edit "${pr_num}" --title "${title}" --body "${title}"
175-
fi
177+
fi

.github/workflows/update_generation_config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
schedule:
1919
- cron: '0 2 * * *'
2020
workflow_dispatch:
21-
2221
jobs:
2322
update-generation-config:
2423
runs-on: ubuntu-24.04
@@ -30,6 +29,9 @@ jobs:
3029
with:
3130
fetch-depth: 0
3231
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
32+
- name: Install Dependencies
33+
shell: bash
34+
run: sudo apt-get update && sudo apt-get install -y libxml2-utils
3335
- name: Update params in generation config to latest
3436
shell: bash
3537
run: |
@@ -40,5 +42,4 @@ jobs:
4042
--base_branch "${base_branch}" \
4143
--repo ${{ github.repository }}
4244
env:
43-
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
44-
45+
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}

0 commit comments

Comments
 (0)