Skip to content

Commit d343ba2

Browse files
committed
Using snapshot for nightly
1 parent f911f79 commit d343ba2

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.github/workflows/java-examples.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,36 @@ jobs:
7272
timeout_minutes: 40
7373
max_attempts: 3
7474
command: |
75-
pip install yq
76-
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
77-
latest_snapshot=$(echo "$xml_content" | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | last | .text')
78-
echo "Latest Selenium Snapshot: $latest_snapshot"
79-
cd examples/java
80-
mvn -B -U test -D"jdk.internal.httpclient.disableHostnameVerification=true"
81-
75+
# Get current selenium.version from Maven
76+
current_version=$(mvn -f examples/java/pom.xml help:evaluate -Dexpression=selenium.version -q -DforceStdout)
77+
echo "Current selenium.version: $current_version"
78+
# If version is in the form X.Y.Z, bump minor and set to SNAPSHOT
79+
if [[ $current_version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
80+
major="${BASH_REMATCH[1]}"
81+
minor="${BASH_REMATCH[2]}"
82+
next_minor=$((minor + 1))
83+
new_version="$major.$next_minor.0-SNAPSHOT"
84+
echo "Using selenium.version $new_version for tests"
85+
cd examples/java
86+
mvn -B -U test -D"jdk.internal.httpclient.disableHostnameVerification=true" -Dselenium.version=$new_version
87+
fi
8288
- name: Run Tests Nightly Windows
8389
if: matrix.release == 'nightly' && matrix.os == 'windows'
8490
uses: nick-invision/[email protected]
8591
with:
8692
timeout_minutes: 40
8793
max_attempts: 3
8894
command: |
89-
pip install yq
90-
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
91-
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | last | .text'
92-
Write-Output "Latest Selenium Snapshot: $latest_snapshot"
93-
cd examples/java
94-
mvn -B -U test -D"jdk.internal.httpclient.disableHostnameVerification=true"
95+
# Get current selenium.version from Maven
96+
$current_version = & mvn -f examples/java/pom.xml help:evaluate -Dexpression=selenium.version -q -DforceStdout
97+
Write-Output "Current selenium.version: $current_version"
98+
# If version is in the form X.Y.Z, bump minor and set to SNAPSHOT
99+
if ($current_version -match '^([0-9]+)\.([0-9]+)\.([0-9]+)$') {
100+
$major = $matches[1]
101+
$minor = $matches[2]
102+
$next_minor = [int]$minor + 1
103+
$new_version = "$major.$next_minor.0-SNAPSHOT"
104+
Write-Output "Using selenium.version $new_version for tests"
105+
cd examples/java
106+
& mvn -B -U test -D"jdk.internal.httpclient.disableHostnameVerification=true" -Dselenium.version=$new_version
107+
}

examples/java/pom.xml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818

1919
<repositories>
2020
<repository>
21-
<id>sonatype-nexus-snapshots</id>
22-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
23-
<snapshots>
24-
<enabled>true</enabled>
25-
</snapshots>
21+
<name>Central Portal Snapshots</name>
22+
<id>central-portal-snapshots</id>
23+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
24+
<releases>
25+
<enabled>false</enabled>
26+
</releases>
27+
<snapshots>
28+
<enabled>true</enabled>
29+
</snapshots>
2630
</repository>
2731
</repositories>
2832

0 commit comments

Comments
 (0)