Skip to content

Commit 0d65381

Browse files
committed
chore(do not merge): demo of template files fix
1 parent 2a82de0 commit 0d65381

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

.github/scripts/update_generation_config.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ set -e
1515
function get_latest_released_version() {
1616
local group_id=$1
1717
local artifact_id=$2
18-
latest=$(curl -s "https://search.maven.org/solrsearch/select?q=g:${group_id}+AND+a:${artifact_id}&core=gav&rows=500&wt=json" | jq -r '.response.docs[] | select(.v | test("^[0-9]+(\\.[0-9]+)*$")) | .v' | sort -V | tail -n 1)
19-
echo "${latest}"
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)
20+
if [[ -z "${latest}" ]]; then
21+
echo "The latest version of ${group_id}:${artifact_id} is empty."
22+
echo "The returned json from maven.org is invalid: ${json_content}"
23+
exit 1
24+
else
25+
echo "${latest}"
26+
fi
2027
}
2128

2229
# Update a key to a new value in the generation config.

.github/workflows/ci.yaml

+1-9
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,15 @@ jobs:
5959
env:
6060
JOB_TYPE: test
6161
windows:
62-
# Building using Java 11 and run the tests with Java 8 runtime
6362
runs-on: windows-latest
6463
steps:
6564
- name: Support longpaths
6665
run: git config --system core.longpaths true
6766
- uses: actions/checkout@v4
68-
- uses: actions/setup-java@v4
69-
with:
70-
java-version: 8
71-
distribution: temurin
72-
- name: "Set jvm system property environment variable for surefire plugin (unit tests)"
73-
run: echo "SUREFIRE_JVM_OPT=-Djvm=${JAVA_HOME}\bin\java" >> $GITHUB_ENV
74-
shell: bash
7567
- uses: actions/setup-java@v4
7668
with:
7769
distribution: temurin
78-
java-version: 11
70+
java-version: 8
7971
- run: java -version
8072
- run: .kokoro/build.bat
8173
env:

.github/workflows/update_generation_config.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
steps:
2929
- uses: actions/checkout@v4
3030
with:
31+
fetch-depth: 0
3132
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
3233
- name: Update params in generation config to latest
3334
shell: bash
@@ -36,7 +37,8 @@ jobs:
3637
[ -z "$(git config user.email)" ] && git config --global user.email "[email protected]"
3738
[ -z "$(git config user.name)" ] && git config --global user.name "cloud-java-bot"
3839
bash .github/scripts/update_generation_config.sh \
39-
--base_branch "${base_branch}"\
40+
--base_branch "${base_branch}" \
4041
--repo ${{ github.repository }}
4142
env:
4243
GH_TOKEN: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
44+

0 commit comments

Comments
 (0)