Skip to content
Snippets Groups Projects
Commit b6e32c61 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'latest-release' into 'master'

Also publish a file containing the latest release

See merge request funkwhale/funkwhale!861
parents 60758358 46039e4f
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
python -m sphinx . $BUILD_PATH python -m sphinx . $BUILD_PATH
TARGET_PATH="$BUILD_PATH/swagger" ./build_swagger.sh TARGET_PATH="$BUILD_PATH/swagger" ./build_swagger.sh
python ./get-releases-json.py > $BUILD_PATH/releases.json python ./get-releases-json.py > $BUILD_PATH/releases.json
python ./get-releases-json.py --latest > $BUILD_PATH/latest
import argparse
import json import json
import subprocess import subprocess
...@@ -32,11 +33,26 @@ def get_versions(): ...@@ -32,11 +33,26 @@ def get_versions():
return sorted(valid, key=lambda tag: StrictVersion(tag["id"]), reverse=True) return sorted(valid, key=lambda tag: StrictVersion(tag["id"]), reverse=True)
def main(): def main(latest=False):
versions = get_versions() versions = get_versions()
if latest:
print(versions[0]["id"])
else:
data = {"count": len(versions), "releases": versions} data = {"count": len(versions), "releases": versions}
print(json.dumps(data)) print(json.dumps(data, sort_keys=True, indent=2))
if __name__ == "__main__": if __name__ == "__main__":
main() parser = argparse.ArgumentParser(
"""
Compile release data and output in in JSON format
"""
)
parser.add_argument(
"-l",
"--latest",
action="store_true",
help="Only print the latest version then exit",
)
args = parser.parse_args()
main(latest=args.latest)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment