-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
62 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,4 +327,4 @@ pip-selfcheck.json | |
release | ||
release.tar.gz | ||
**/device_settings.json | ||
.env | ||
.env |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,11 @@ release | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
version.json | ||
|
||
**.js | ||
**.d.ts | ||
**.mjs | ||
**.d.mts | ||
**.tsbuildinfo |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import requests | ||
import json | ||
import re | ||
|
||
# Github repo information | ||
GITHUB_API_URL = "https://api.github.com/repos/DeepWaterExploration/DWE_OS_2/tags" | ||
VERSION_FILE_PATH = "frontend/version.json" | ||
|
||
def get_latest_tag(): | ||
# Fetch the latest tags from GitHub API | ||
response = requests.get(GITHUB_API_URL) | ||
|
||
if response.status_code == 200: | ||
tags = response.json() | ||
if tags: | ||
return tags[0]['name'] # The latest tag is the first one | ||
return None | ||
|
||
def update_version_json(new_version): | ||
# Load the current version.json file | ||
with open(VERSION_FILE_PATH, 'r') as f: | ||
data = json.load(f) | ||
|
||
# Update the version string | ||
data['version'] = new_version | ||
|
||
# Write the new version back to the json file | ||
with open(VERSION_FILE_PATH, 'w') as f: | ||
json.dump(data, f, indent=4) | ||
|
||
if __name__ == "__main__": | ||
# Get the latest tag from GitHub | ||
latest_tag = get_latest_tag() | ||
|
||
if latest_tag: | ||
print(f"Latest tag found: {latest_tag}") | ||
|
||
# Update the version.json file | ||
update_version_json(latest_tag) | ||
print("version.json updated successfully.") | ||
else: | ||
print("No tags found or failed to fetch the latest tag.") |