Skip to content

Commit

Permalink
Revise doc build for recent CI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed May 4, 2020
1 parent 7018720 commit b13ef15
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 76 deletions.
89 changes: 43 additions & 46 deletions ci/subst-release-info.py
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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:
Expand Down
59 changes: 29 additions & 30 deletions docs/installation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

Windows 10 or later is required to run WezTerm.

<a href="{{ windows_stable }}" class="btn">Download for Windows</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/WezTerm-windows-nightly.zip" class="btn">Nightly for Windows</a>
1. Download <a href="{{ windows_stable }}">Release</a>
<a href="{{ windows_zip_stable }}" class="btn">Download for Windows</a>
<a href="{{ windows_zip_nightly }}" class="btn">Nightly for Windows</a>
1. Download <a href="{{ windows_zip_stable }}">Release</a>
2. Extract the zipfile and double-click `wezterm.exe` to run the UI
3. Configuration instructions can be [found here](config/index.html)

Expand All @@ -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.

<a href="{{ macos_stable }}" class="btn">Download for macOS</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/WezTerm-macos-nightly.zip" class="btn">Nightly for macOS</a>
1. Download <a href="{{ macos_stable }}">Release</a>
<a href="{{ macos_zip_stable }}" class="btn">Download for macOS</a>
<a href="{{ macos_zip_nightly }}" class="btn">Nightly for macOS</a>
1. Download <a href="{{ macos_zip_stable }}">Release</a>
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.
Expand All @@ -28,56 +28,56 @@ 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.

<a href="{{ ubuntu_stable }}" class="btn">Download for Ubuntu</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/wezterm-nightly.deb" class="btn">Nightly for Ubuntu</a>
<a href="{{ ubuntu16_deb_stable }}" class="btn">Download for Ubuntu</a>
<a href="{{ ubuntu16_deb_nightly }}" class="btn">Nightly for Ubuntu</a>

```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.

<a href="{{ fedora_stable }}" class="btn">Download for Fedora</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/wezterm-nightly-fedora31.rpm" class="btn">Nightly for Fedora</a>
<a href="{{ fedora31_rpm_stable }}" class="btn">Download for Fedora</a>
<a href="{{ fedora31_rpm_nightly }}" class="btn">Nightly for Fedora</a>

```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.

<!-- a href="{{ centos_stable }}" class="btn">Download for CentOS</a -->
<a href="https://github.com/wez/wezterm/releases/download/nightly/wezterm-nightly-centos7.rpm" class="btn">Nightly for CentOS</a>
<a href="{{ centos7_rpm_stable }}" class="btn">Download for CentOS</a>
<a href="{{ centos7_rpm_nightly }}" class="btn">Nightly for CentOS</a>

```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

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.

<a href="{{ appimage_stable }}" class="btn">AppImage</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/WezTerm-nightly.AppImage" class="btn">Nightly AppImage</a>
<a href="{{ ubuntu16_AppImage_stable }}" class="btn">AppImage</a>
<a href="{{ ubuntu16_AppImage_nightly }}" class="btn">Nightly AppImage</a>

```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.
Expand All @@ -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.

<a href="{{ linux_bin_stable }}" class="btn">Download raw Linux binaries</a>
<a href="https://github.com/wez/wezterm/releases/download/nightly/wezterm-nightly.tar.xz"
class="btn">Nightly raw Linux binaries</a>
<a href="{{ linux_raw_bin_stable }}" class="btn">Download raw Linux binaries</a>
<a href="{{ linux_raw_bin_nightly }}" class="btn">Nightly raw Linux binaries</a>

## Installing from source

Expand All @@ -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`

Expand All @@ -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
Expand Down

0 comments on commit b13ef15

Please sign in to comment.