From 87350bde4d99382991c99442561483d3d5925428 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 5 Apr 2021 12:29:13 -0700 Subject: [PATCH] docs: explicitly fetch nightly info We have more releases than fit in a page, so the nightly release isn't included in the json we request. Explicitly fetch it! --- ci/build-docs.sh | 2 ++ ci/subst-release-info.py | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ci/build-docs.sh b/ci/build-docs.sh index 52b959926..851e8a444 100755 --- a/ci/build-docs.sh +++ b/ci/build-docs.sh @@ -1,6 +1,8 @@ #!/bin/bash +set -x [[ -f /tmp/wezterm.releases.json ]] || curl https://api.github.com/repos/wez/wezterm/releases > /tmp/wezterm.releases.json +[[ -f /tmp/wezterm.nightly.json ]] || curl https://api.github.com/repos/wez/wezterm/releases/tags/nightly > /tmp/wezterm.nightly.json python3 ci/subst-release-info.py || exit 1 python3 ci/generate-docs.py || exit 1 mdbook build docs diff --git a/ci/subst-release-info.py b/ci/subst-release-info.py index 15578336f..d4136cd0a 100755 --- a/ci/subst-release-info.py +++ b/ci/subst-release-info.py @@ -65,12 +65,16 @@ def load_release_info(): with open("/tmp/wezterm.releases.json") as f: release_info = json.load(f) - latest = release_info[0] - nightly = None + with open("/tmp/wezterm.nightly.json") as f: + nightly = json.load(f) + + + latest = None for rel in release_info: - if rel["tag_name"] == "nightly": - nightly = rel - break + if rel["prerelease"]: + continue + latest = rel + break latest = categorize(latest) nightly = categorize(nightly)