diff --git a/ci/subst-release-info.py b/ci/subst-release-info.py index 673fa89049a..a377c993ad1 100755 --- a/ci/subst-release-info.py +++ b/ci/subst-release-info.py @@ -1,54 +1,55 @@ #!/usr/bin/env python3 import json import sys +import re -def release_to_links(rel): - source = None - macos = None - centos = None - fedora = None - ubuntu = None - windows = None - linux_bin = None - appimage = None +CATEGORIZE = { + r".el7.x86_64.rpm$": "centos7_rpm", + r".centos7.rpm$": "centos7_rpm", + r".fc31.x86_64.rpm$": "fedora31_rpm", + r".fedora31.rpm$": "fedora31_rpm", + r"Debian9.12.deb$": "debian9_deb", + r"Debian10.deb$": "debian10_deb", + r"Ubuntu16.04.AppImage$": "ubuntu16_AppImage", + r"^WezTerm-.*.x86_64.AppImage$": "ubuntu16_AppImage", + r"Ubuntu16.04.deb$": "ubuntu16_deb", + r"^wezterm-\d+-\d+-[a-f0-9]+.deb$": "ubuntu16_deb", + r"Ubuntu18.04.deb$": "ubuntu18_deb", + r"Ubuntu19.10.deb$": "ubuntu19_deb", + r"Ubuntu16.04.tar.xz$": "linux_raw_bin", + r"^wezterm-\d+-\d+-[a-f0-9]+.tar.xz$": "linux_raw_bin", + r"src.tar.gz$": "src", + r"^WezTerm-macos-.*.zip$": "macos_zip", + r"^WezTerm-windows-.*.zip$": "windows_zip", +} - tag_name = "wezterm-%s" % rel["tag_name"] +def categorize(rel): + downloads = {} + tag_name = "wezterm-%s" % rel["tag_name"] for asset in rel["assets"]: url = asset["browser_download_url"] name = asset["name"] - if "-src.tar.gz" in name: - source = (url, name, tag_name) - elif ".deb" in name: - ubuntu = (url, name, tag_name) - elif ".tar.xz" in name: - linux_bin = (url, name, tag_name) - elif ".rpm" in name: - if ('fedora' in name) or ('fc31' in name): - fedora = (url, name, tag_name) - if ('centos' in name) or ('el7' in name): - centos = (url, name, tag_name) - elif "WezTerm-macos-" in name: - macos = (url, name, tag_name) - elif "WezTerm-windows-" in name: - windows = (url, name, tag_name) - elif ".AppImage" in name: - appimage = (url, name, tag_name) - return { - "source": source, - "ubuntu": ubuntu, - "linux_bin": linux_bin, - "fedora": fedora, - "centos": centos, - "macos": macos, - "windows": windows, - "appimage": appimage, - } + for k, v in CATEGORIZE.items(): + if re.search(k, name): + downloads[v] = (url, name, tag_name) + + return downloads def pretty(o): return json.dumps(o, indent=4, sort_keys=True, separators=(',', ':')) +def build_subst(subst, stable, categorized): + for (kind, info) in categorized.items(): + if info is None: + continue + url, name, dir = info + kind = f"{kind}_{stable}" + subst["{{ %s }}" % kind] = url + subst["{{ %s_asset }}" % kind] = name + subst["{{ %s_dir }}" % kind] = dir + def load_release_info(): with open("/tmp/wezterm.releases.json") as f: release_info = json.load(f) @@ -60,20 +61,16 @@ def load_release_info(): nightly = rel break - latest = release_to_links(latest) - nightly = release_to_links(nightly) + latest = categorize(latest) + nightly = categorize(nightly) print('latest: ', pretty(latest)) print('nightly: ', pretty(nightly)) subst = {} - for (kind, info) in latest.items(): - if info is None: - continue - url, name, dir = info - subst["{{ %s_stable }}" % kind] = url - subst["{{ %s_stable_asset }}" % kind] = name - subst["{{ %s_stable_dir }}" % kind] = dir + build_subst(subst, "stable", latest) + build_subst(subst, "nightly", nightly) + print(pretty(subst)) with open("docs/installation.markdown", "r") as input: with open("docs/installation.md", "w") as output: diff --git a/docs/installation.markdown b/docs/installation.markdown index e7131e609fb..efef3985eb1 100644 --- a/docs/installation.markdown +++ b/docs/installation.markdown @@ -3,9 +3,9 @@ Windows 10 or later is required to run WezTerm. -Download for Windows -Nightly for Windows -1. Download Release +Download for Windows +Nightly for Windows +1. Download Release 2. Extract the zipfile and double-click `wezterm.exe` to run the UI 3. Configuration instructions can be [found here](config/index.html) @@ -14,9 +14,9 @@ Windows 10 or later is required to run WezTerm. The CI system builds the package on macOS Mojave (10.14). It may run on earlier versions of macOS, but that has not been tested. -Download for macOS -Nightly for macOS -1. Download Release +Download for macOS +Nightly for macOS +1. Download Release 2. Extract the zipfile and drag the `WezTerm.app` bundle to your `Applications` folder 3. First time around, you may need to right click and select `Open` to allow launching the application that your just downloaded from the internet. @@ -28,43 +28,43 @@ versions of macOS, but that has not been tested. The CI system builds a `.deb` file on Ubuntu 16.04. It is compatible with other debian style systems, including Debian 9 (Stretch) and later versions. -Download for Ubuntu -Nightly for Ubuntu +Download for Ubuntu +Nightly for Ubuntu ```bash -curl -LO {{ ubuntu_stable }} -sudo apt install -y ./{{ ubuntu_stable_asset }} +curl -LO {{ ubuntu16_deb_stable }} +sudo apt install -y ./{{ ubuntu16_deb_stable_asset }} ``` -* The package installs `/usr/bin/wezterm` and `/usr/share/applications/wezterm.desktop` +* The package installs `/usr/bin/wezterm` and `/usr/share/applications/org.wezfurlong.wezterm.desktop` * Configuration instructions can be [found here](config/index.html) ## Installing on Fedora The CI system builds an `.rpm` file on Fedora 31. -Download for Fedora -Nightly for Fedora +Download for Fedora +Nightly for Fedora ```bash -sudo dnf install -y {{ fedora_stable }} +sudo dnf install -y {{ fedora31_rpm_stable }} ``` -* The package installs `/usr/bin/wezterm` and `/usr/share/applications/wezterm.desktop` +* The package installs `/usr/bin/wezterm` and `/usr/share/applications/org.wezfurlong.wezterm.desktop` * Configuration instructions can be [found here](config/index.html) ## Installing on CentOS The CI system builds an `.rpm` file on CentOS 7. - -Nightly for CentOS +Download for CentOS +Nightly for CentOS ```bash -sudo dnf install -y https://github.com/wez/wezterm/releases/download/nightly/wezterm-nightly-centos7.rpm +sudo dnf install -y {{ centos7_rpm_stable }} ``` -* The package installs `/usr/bin/wezterm` and `/usr/share/applications/wezterm.desktop` +* The package installs `/usr/bin/wezterm` and `/usr/share/applications/org.wezfurlong.wezterm.desktop` * Configuration instructions can be [found here](config/index.html) ## Installing on Linux via AppImage @@ -72,12 +72,12 @@ sudo dnf install -y https://github.com/wez/wezterm/releases/download/nightly/wez If you have some other Linux system, or otherwise prefer AppImage over your system package format, you can download a build by following these steps. -AppImage -Nightly AppImage +AppImage +Nightly AppImage ```bash -curl -LO {{ appimage_stable }} -chmod +x {{ appimage_stable_asset }} +curl -LO {{ ubuntu16_AppImage_stable }} +chmod +x {{ ubuntu16_AppImage_stable_asset }} ``` You may then execute the appimage directly to launch wezterm. @@ -89,9 +89,8 @@ You may then execute the appimage directly to launch wezterm. Another option for linux is a raw binary archive. These are the same binaries that are built for Ubuntu but provided in a tarball. -Download raw Linux binaries -Nightly raw Linux binaries +Download raw Linux binaries +Nightly raw Linux binaries ## Installing from source @@ -100,7 +99,7 @@ WezTerm should run on any modern unix as well as Windows 10 and macOS. * Install `rustup` to get the `rust` compiler installed on your system. [Install rustup](https://www.rust-lang.org/en-US/install.html) -* Rust version 1.39 or later is required +* Rust version 1.41 or later is required * Build in release mode: `cargo build --release` * Run it via either `cargo run --release` or `target/release/wezterm` @@ -113,9 +112,9 @@ download a smaller source tarball using these steps: ```bash curl https://sh.rustup.rs -sSf | sh -s -curl -LO {{ source_stable }} -tar -xzf {{ source_stable_asset }} -cd {{ source_stable_dir }} +curl -LO {{ src_stable }} +tar -xzf {{ src_stable_asset }} +cd {{ src_stable_dir }} sudo ./get-deps cargo build --release cargo run --release -- start