-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add a release action This action will build and deploy docs for a new release, copying the built docs artifacts to both the dev and the {version} folders in napari.github.io. It will also update the stable symlink to point to the new version folder. This action will be triggered by a new release tag pushed to the repo or by manually trigerring the action with an input specifying the new version (any input different from the default dev will trigger the action.) * Fix release action execution condition * Add condition to filter out release candidates from release action * Add script to update version switcher * WIP: Testing on fork
- Loading branch information
Showing
3 changed files
with
88 additions
and
5 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
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,34 @@ | ||
import sys | ||
import json | ||
|
||
|
||
def update_version_switcher(new_version): | ||
"""Update version_switcher.json after a new release.""" | ||
with open("docs/_static/version_switcher.json", "r") as f: | ||
switcher = json.load(f) | ||
oldstable = switcher[1] | ||
|
||
newstable = oldstable.copy() | ||
newstable["version"] = new_version | ||
newstable["name"] = f"stable ({new_version})" | ||
|
||
oldstable["name"] = f"{oldstable['version']}" | ||
del oldstable["preferred"] | ||
oldstable["url"] = oldstable["url"].replace("stable", oldstable["version"]) | ||
|
||
switcher[1] = oldstable | ||
switcher.insert(1, newstable) | ||
with open("docs/_static/version_switcher.json", "w") as f: | ||
json.dump(switcher, f, indent=4) | ||
|
||
print(f"Version switcher updated to {new_version}") | ||
print(f"Old stable version: {switcher[2]}") | ||
print(f"New stable version: {switcher[1]}") | ||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 2: | ||
print("Usage: python update_switcher.py <new_version>") | ||
sys.exit() | ||
new_version = sys.argv[1] | ||
update_version_switcher(new_version) |