Skip to content

Commit

Permalink
update swither update for prereleases
Browse files Browse the repository at this point in the history
  • Loading branch information
rettigl committed Jan 19, 2025
1 parent a47e3b0 commit 2811aa0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion sed/update_switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
data = json.load(f)
if branch.startswith("refs/tags"): # add a new version tag
version_tag = branch.split("/")[-1]
prerelease = "a" in version_tag
for item in data:
if version_tag in item.get("name", ""):
present = True
if "stable" in item.get("name", ""):
if "latest" in item.get("name", ""):
item["version"] = version
item["url"] = "https://opencompes.github.io/docs/sed/" + version_tag
if "stable" in item.get("name", "") and not prerelease:
item["version"] = version
item["url"] = "https://opencompes.github.io/docs/sed/" + version_tag
if not present:
Expand Down
6 changes: 3 additions & 3 deletions specsanalyzer/switcher.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[
{
"name": "latest",
"version": "0.5.2.dev2+gd6a55dd",
"version": "0.6.0a2",
"url": "https://opencompes.github.io/docs/specsanalyzer/latest"
},
{
"name": "stable",
"version": "0.6.0a2",
"url": "https://opencompes.github.io/docs/specsanalyzer/v0.6.0a2",
"version": "0.5.1",
"url": "https://opencompes.github.io/docs/specsanalyzer/v0.5.1",
"preferred": "true"
},
{
Expand Down
6 changes: 5 additions & 1 deletion specsanalyzer/update_switcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
data = json.load(f)
if branch.startswith("refs/tags"): # add a new version tag
version_tag = branch.split("/")[-1]
prerelease = "a" in version_tag
for item in data:
if version_tag in item.get("name", ""):
present = True
if "stable" in item.get("name", ""):
if "latest" in item.get("name", ""):
item["version"] = version
item["url"] = "https://opencompes.github.io/docs/specsanalyzer/" + version_tag
if "stable" in item.get("name", "") and not prerelease:
item["version"] = version
item["url"] = "https://opencompes.github.io/docs/specsanalyzer/" + version_tag
if not present:
Expand Down

0 comments on commit 2811aa0

Please sign in to comment.