File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -ex
2
+ set -e
3
3
# This script should be run at the root of the repository.
4
4
# This script is used to update googleapis_commitish, gapic_generator_version,
5
5
# and libraries_bom_version in generation configuration at the time of running
@@ -15,10 +15,8 @@ set -ex
15
15
function get_latest_released_version() {
16
16
local group_id=$1
17
17
local artifact_id=$2
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}" )
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)
22
20
if [[ -z " ${latest} " ]]; then
23
21
echo " The latest version of ${group_id} :${artifact_id} is empty."
24
22
echo " The returned json from maven.org is invalid: ${json_content} "
@@ -174,4 +172,4 @@ if [ -z "${pr_num}" ]; then
174
172
else
175
173
git push
176
174
gh pr edit " ${pr_num} " --title " ${title} " --body " ${title} "
177
- fi
175
+ fi
Original file line number Diff line number Diff line change 18
18
schedule :
19
19
- cron : ' 0 2 * * *'
20
20
workflow_dispatch :
21
+
21
22
jobs :
22
23
update-generation-config :
23
24
runs-on : ubuntu-24.04
29
30
with :
30
31
fetch-depth : 0
31
32
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
35
33
- name : Update params in generation config to latest
36
34
shell : bash
37
35
run : |
42
40
--base_branch "${base_branch}" \
43
41
--repo ${{ github.repository }}
44
42
env :
45
- GH_TOKEN : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
43
+ GH_TOKEN : ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
44
+
You can’t perform that action at this time.
0 commit comments