2019-12-30 08:24:08 +03:00
|
|
|
#!/bin/bash
|
2022-07-19 16:38:50 +03:00
|
|
|
|
2023-01-23 17:15:50 +03:00
|
|
|
tracked_markdown=$(mktemp)
|
|
|
|
trap "rm ${tracked_markdown}" "EXIT"
|
|
|
|
git ls-tree -r HEAD --name-only docs | egrep '\.(markdown|md)$' > $tracked_markdown
|
2022-07-19 16:38:50 +03:00
|
|
|
|
2023-01-23 17:15:50 +03:00
|
|
|
gelatyx --language lua --file-list $tracked_markdown --language-config ci/stylua.toml
|
|
|
|
gelatyx --language lua --file-list $tracked_markdown --language-config ci/stylua.toml --check || exit 1
|
2022-07-19 16:38:50 +03:00
|
|
|
|
2021-04-05 22:29:13 +03:00
|
|
|
set -x
|
2019-12-30 08:24:08 +03:00
|
|
|
|
2022-12-22 20:52:42 +03:00
|
|
|
# Use the GH CLI to make an authenticated request if available,
|
2023-01-21 16:38:38 +03:00
|
|
|
# otherwise just do an ad-hoc curl.
|
|
|
|
# However, if we are called from within a GH actions workflow (BUILD_REASON
|
|
|
|
# is set), only use `gh` if GH_TOKEN is also set, otherwise it will refuse
|
|
|
|
# to run.
|
2022-12-22 20:52:42 +03:00
|
|
|
function ghapi() {
|
2023-01-21 16:38:38 +03:00
|
|
|
if hash gh 2>/dev/null && test \( -n "$BUILD_REASON" -a -n "$GH_TOKEN" \) -o -z "$BUILD_REASON"; then
|
2022-12-22 20:52:42 +03:00
|
|
|
gh api $1
|
|
|
|
else
|
|
|
|
curl https://api.github.com$1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
[[ -f /tmp/wezterm.releases.json ]] || ghapi /repos/wez/wezterm/releases > /tmp/wezterm.releases.json
|
|
|
|
[[ -f /tmp/wezterm.nightly.json ]] || ghapi /repos/wez/wezterm/releases/tags/nightly > /tmp/wezterm.nightly.json
|
2021-02-01 04:15:35 +03:00
|
|
|
python3 ci/subst-release-info.py || exit 1
|
|
|
|
python3 ci/generate-docs.py || exit 1
|
2022-04-04 08:09:17 +03:00
|
|
|
mdbook-mermaid install docs
|
2019-12-30 08:24:08 +03:00
|
|
|
mdbook build docs
|
|
|
|
|
2021-12-12 17:54:01 +03:00
|
|
|
rm gh_pages/html/README.markdown
|
2022-02-03 18:19:51 +03:00
|
|
|
cp assets/fonts/Symbols-Nerd-Font-Mono.ttf gh_pages/html/fonts/
|
2021-02-24 20:27:13 +03:00
|
|
|
cp assets/icon/terminal.png gh_pages/html/favicon.png
|
2021-12-30 04:10:54 +03:00
|
|
|
cp "assets/icon/wezterm-icon.svg" gh_pages/html/favicon.svg
|