mirror of
https://github.com/donlucasx/xscapes.git
synced 2026-10-20 08:43:32 +02:00
The first outside tester followed the page and got `zsh: command not found: xscapes`. `go install` drops the binary in ~/go/bin, which is on no Mac's PATH by default, and prints nothing about it; the page never said Go was required either. site/install.sh (curl -fsSL .../install.sh | sh) downloads the release binary for the OS and chip into ~/.local/bin, adds one line to the shell's rc file when that directory is not on PATH, and prints the next commands with a path that works in the same window. No binary for the platform: go install into the same directory. No Go: say so and stop. site/release.sh builds the four binaries from a clean tagged tree and creates the GitHub release. publish.sh ships the script beside the page. The page and the README say the new line; the Go path stays as the alternative, with the ~/go/bin warning. installsh_test.go runs the real script under /bin/sh against a local server serving the real binary, through every branch. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
30 lines
1.5 KiB
Bash
Executable File
30 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# publish.sh puts the submission page online: site/index.html and its clips
|
|
# become the whole of an orphan gh-pages branch, force-pushed, which GitHub
|
|
# Pages serves at https://donlucasx.github.io/xscapes/ (Settings -> Pages ->
|
|
# branch gh-pages, folder /). No workflow file, because the stored GitHub
|
|
# credential has no `workflow` scope and a push carrying one is refused.
|
|
#
|
|
# Run it from the repo root after `go run . -site site`. Nothing else travels:
|
|
# the page is self-contained.
|
|
set -eu
|
|
root=$(git rev-parse --show-toplevel)
|
|
cd "$root"
|
|
stage=$(mktemp -d)
|
|
trap 'rm -rf "$stage"' EXIT
|
|
# The page is ONE file now. Every animation is embedded as text rather than
|
|
# screenshotted into a GIF, so there is nothing beside it to copy: 5.1MB of
|
|
# clips became 355KB of markup, and anim/ is build scratch. Two things
|
|
# travel with it, both fetched by absolute URL: the share card, og.png,
|
|
# which the page's Open Graph tags point at (a card scraper needs an image
|
|
# URL, and the Commons proxy serves only the page), and install.sh, which
|
|
# the page's install line pipes into sh.
|
|
cp site/index.html site/og.png site/install.sh "$stage/"
|
|
touch "$stage/.nojekyll"
|
|
git -C "$stage" init -q -b gh-pages
|
|
git -C "$stage" add -A
|
|
git -C "$stage" -c user.name="$(git config user.name)" -c user.email="$(git config user.email)" \
|
|
commit -q -m "site: $(git rev-parse --short HEAD)"
|
|
git -C "$stage" push -q --force "$(git remote get-url origin)" gh-pages:gh-pages
|
|
echo "pushed gh-pages from $(git rev-parse --short HEAD): https://donlucasx.github.io/xscapes/"
|