Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

ci: give the draft release its download list, and drop the checksum files

RoversX0e00d1631fe5
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index eabbe8a2..f5e16032 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -96,9 +96,10 @@ jobs:
version="$INPUT_VERSION"
if [ -n "$version" ]; then
- # Accept either form. The tag keeps the v and the asset names drop
- # it, which is the split ci/deploy.sh and the Homebrew cask
- # template already assume.
+ # A leading v is accepted and dropped. Nothing downstream wants
+ # one: deb and rpm version fields reject it outright, Homebrew
+ # expects a bare version, and the `tags: v*` trigger that used to
+ # require it is gone. One form, in the tag and in every filename.
version="${version#v}"
# This becomes a filename that ci/deploy.sh builds paths from and
# hands to rm -rf. Same character rule as ci/macos-package.sh.
@@ -108,7 +109,7 @@ jobs:
exit 1
;;
esac
- release_tag="v$version"
+ release_tag="$version"
else
release_tag="$(bash ci/tag-name.sh)"
version="$release_tag"
@@ -469,32 +470,20 @@ jobs:
path: dist
merge-multiple: true
- - name: Checksum
+ # No checksum files are published. GitHub records a sha256 for every
+ # release asset as it is uploaded -- including the macOS zip attached by
+ # hand -- and shows it on the asset. A checksums file of our own would
+ # cover only what CI built, and unsigned it sits on the same server as
+ # the packages, so it proves no more than the digest already does.
+ - name: Check there is something to publish
run: |
set -eu
- mkdir -p dist
- cd dist
# A plan with every platform deselected reaches this job with nothing
# downloaded. Stop here rather than let ci/create-release.sh mint an
# empty draft on the default branch.
- [ -n "$(ls -A .)" ] || { echo "::error::no artifacts to publish"; exit 1; }
- # One SHA256SUMS rather than a .sha256 beside every file. A release
- # page lists its assets to a human, so a sidecar each doubles the
- # length of that list; the sidecar convention belongs to the CDN
- # directories it came from, where you fetch one file and its sibling
- # and never see a listing. `sha256sum -c SHA256SUMS` checks the set.
- #
- # Collected into "$@" rather than passed as a glob because the
- # redirection creates SHA256SUMS before the glob is expanded, so a
- # plain `sha256sum *` would list the file in itself.
- set --
- for f in * ; do
- case "$f" in SHA256SUMS) continue ;; esac
- [ -f "$f" ] || continue
- set -- "$@" "$f"
- done
- sha256sum "$@" > SHA256SUMS
- cat SHA256SUMS
+ [ -d dist ] && [ -n "$(ls -A dist)" ] \
+ || { echo "::error::no artifacts to publish"; exit 1; }
+ ls -l dist
# The tag reaches these steps through env rather than a ${{ }} splice into
# the script body. It derives from free text typed into the Run workflow
diff --git a/ci/create-release.sh b/ci/create-release.sh
index a3fbbe00..5dd4a149 100755
--- a/ci/create-release.sh
+++ b/ci/create-release.sh
@@ -1,17 +1,15 @@
#!/bin/bash
-set -x
+set -ex
name="$1"
+dist="${2:-dist}"
-# Placeholder body. Whoever finishes the release replaces it in the web UI --
-# these two lines are here so a half-finished draft says what it is still
-# missing rather than sitting there blank.
-notes=$(cat <<EOT
-_Draft: replace these notes before publishing._
-
-- [ ] Attach the macOS zip from \`ci/macos-package.sh\`
-- [ ] Write the release notes
-EOT
-)
+# The body is generated from what is actually in $dist -- see
+# ci/release-notes.sh -- so the draft already carries a download list that
+# matches the packages attached to it. Only whoever finishes the release adds
+# what changed.
+notes=$(mktemp)
+trap 'rm -f "$notes"' EXIT
+bash "$(dirname "$0")/release-notes.sh" "$name" "$dist" > "$notes"
# A draft, not a prerelease: a prerelease is publicly visible, so the window
# between CI uploading the Windows and Linux packages and a human attaching the
@@ -20,7 +18,8 @@ EOT
#
# The tag comes into existence when the draft is published, pointing at
# --target. Without it gh would tag the default branch -- a commit nobody
-# built. Re-running the workflow finds the existing draft and only re-uploads.
+# built. Re-running the workflow finds the existing draft and only re-uploads:
+# the notes are written once, so an edit made on the release page survives.
gh release view "$name" || gh release create --draft \
${GITHUB_SHA:+--target "$GITHUB_SHA"} \
- --notes "$notes" --title "$name" "$name"
+ --notes-file "$notes" --title "$name" "$name"
diff --git a/ci/release-notes.sh b/ci/release-notes.sh
new file mode 100755
index 00000000..ee4a32ce
--- /dev/null
+++ b/ci/release-notes.sh
@@ -0,0 +1,142 @@
+#!/bin/bash
+
+# Emits the body of a ThinkTerm release, as Markdown, on stdout.
+#
+# The download list is built from what is actually in the dist directory, so a
+# release that skipped a platform links only to the packages it has. macOS is
+# the exception: its zips are signed and notarized on a laptop and attached to
+# the draft by hand, so that row is written from the names those uploads are
+# expected to carry, and points at files that do not exist yet.
+#
+# Whoever finishes the release writes the "what changed" part above all this on
+# the release page. Everything here is mechanical.
+
+set -euo pipefail
+
+tag="${1:?usage: release-notes.sh <tag> [dist-dir]}"
+dist="${2:-dist}"
+version="${tag#v}"
+
+base="https://github.com/RoversX/ThinkTerm/releases/download/$tag"
+
+# Every Linux package we build is one of these two. Anything unrecognized is
+# labelled 64-bit rather than dropped, so a new architecture shows up wrong
+# rather than silently going missing.
+arch_label() {
+ case "$1" in
+ *arm64* | *aarch64*) echo "ARM64" ;;
+ *) echo "64-bit" ;;
+ esac
+}
+
+# "[64-bit](url) · [ARM64](url)" for every file matching a glob. Returns 1 when
+# the release contains none of them, so the caller can drop the whole row.
+#
+# Two passes so that 64-bit leads, whatever the filenames sort as: it is what
+# most people want, and a row reads as a recommendation followed by the
+# alternatives.
+links_by_arch() {
+ local out='' f want
+ for want in x86 arm; do
+ for f in "$dist"/$1; do
+ [ -f "$f" ] || continue
+ f=$(basename "$f")
+ case "$f" in
+ *arm64* | *aarch64*) [ "$want" = arm ] || continue ;;
+ *) [ "$want" = x86 ] || continue ;;
+ esac
+ [ -z "$out" ] || out="$out · "
+ out="$out[$(arch_label "$f")]($base/$f)"
+ done
+ done
+ [ -n "$out" ] || return 1
+ printf '%s\n' "$out"
+}
+
+# One named file. Used where the architecture is not what distinguishes the
+# download -- the Windows installer against the portable zip, say.
+link_to() {
+ local f
+ for f in "$dist"/$2; do
+ [ -f "$f" ] || continue
+ printf '[%s](%s/%s)' "$1" "$base" "$(basename "$f")"
+ return 0
+ done
+ return 1
+}
+
+# The rpms that make up a full install, labelled by package name. Which of them
+# you want is not a question of architecture, and the split exists so that a
+# headless machine can take the multiplexer alone -- so that one is listed
+# separately and excluded here.
+rpm_full_links() {
+ local out='' f name
+ for f in "$dist"/*.rpm; do
+ [ -f "$f" ] || continue
+ f=$(basename "$f")
+ case "$f" in thinkterm-mux-server-*) continue ;; esac
+ name=${f%%-[0-9]*}
+ case "$f" in *arm64* | *aarch64*) name="$name (ARM64)" ;; esac
+ [ -z "$out" ] || out="$out · "
+ out="$out[$name]($base/$f)"
+ done
+ [ -n "$out" ] || return 1
+ printf '%s\n' "$out"
+}
+
+echo "<!-- What changed in this release goes above this line. Then delete it. -->"
+echo
+echo "## Downloads"
+echo
+echo "### macOS"
+echo
+echo "[Apple silicon]($base/ThinkTerm-macos-arm64-$version.zip) · [Intel]($base/ThinkTerm-macos-x86_64-$version.zip)"
+echo
+
+win_setup=$(link_to "Installer" 'ThinkTerm-*-setup.exe') || win_setup=''
+win_zip=$(link_to "Portable zip" 'ThinkTerm-windows-*.zip') || win_zip=''
+if [ -n "$win_setup$win_zip" ]; then
+ echo "### Windows"
+ echo
+ if [ -n "$win_setup" ] && [ -n "$win_zip" ]; then
+ echo "$win_setup · $win_zip"
+ else
+ echo "$win_setup$win_zip"
+ fi
+ echo
+fi
+
+linux=''
+if appimage=$(links_by_arch '*.AppImage'); then
+ linux="$linux
+**AppImage** — \`chmod +x\` and run it; nothing is installed
+
+$appimage
+"
+fi
+if deb=$(links_by_arch '*.deb'); then
+ linux="$linux
+**DEB (Debian / Ubuntu)** — \`sudo apt install ./<file>.deb\`
+
+$deb
+"
+fi
+if rpm_full=$(rpm_full_links); then
+ linux="$linux
+**RPM (Fedora / RHEL)** — put these in one directory, then \`sudo dnf install ./thinkterm-*.rpm\`
+
+$rpm_full
+"
+fi
+if rpm_mux=$(links_by_arch 'thinkterm-mux-server-*.rpm'); then
+ linux="$linux
+**Multiplexer server only** (headless remote host) — \`sudo dnf install ./<file>.rpm\`, and it pulls in no GUI libraries
+
+$rpm_mux
+"
+fi
+
+if [ -n "$linux" ]; then
+ echo "### Linux"
+ echo "$linux"
+fi