-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Update script to fetch Nightly version for examples run (#2040)
Signed-off-by: Viet Nguyen Duc <[email protected]>
- Loading branch information
Showing
10 changed files
with
75 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ jobs: | |
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
java-version: 17 | ||
- name: Run Tests Stable | ||
if: matrix.release == 'stable' | ||
uses: nick-invision/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import subprocess | ||
import json | ||
import argparse | ||
|
||
def get_latest_nightly_version(package_type, package_name): | ||
path_packages_api = f"orgs/seleniumhq/packages/{package_type}/{package_name}/versions" | ||
accept_header = "Accept: application/vnd.github+json" | ||
version_header = "X-GitHub-Api-Version: 2022-11-28" | ||
|
||
gh_api_command = [ | ||
"gh", "api", "-H", accept_header, "-H", version_header, path_packages_api | ||
] | ||
|
||
result = subprocess.run(gh_api_command, capture_output=True, text=True) | ||
if result.returncode != 0: | ||
raise Exception(f"Error executing gh api command: {result.stderr}") | ||
|
||
versions = json.loads(result.stdout) | ||
latest_version = versions[0]['name'] | ||
return latest_version | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description='Get the latest nightly version of a package.') | ||
parser.add_argument('package_type', type=str, help='The type of the package') | ||
parser.add_argument('package_name', type=str, help='The name of the package') | ||
|
||
args = parser.parse_args() | ||
package_type = args.package_type | ||
package_name = args.package_name | ||
|
||
print(get_latest_nightly_version(package_type, package_name)) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import requests | ||
import json | ||
import re | ||
|
||
response = requests.get("https://test.pypi.org/pypi/selenium/json") | ||
data = response.json() | ||
|
||
versions = data['releases'].keys() | ||
sorted_versions = sorted(versions, key=lambda s: [int(part) if part.isdigit() else part for part in re.split(r'(\d+)', s)]) | ||
latest_version = sorted_versions[-1] | ||
|
||
print(latest_version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
requests |