#!/bin/sh # Lays out the download site from whatever the Gradle build produced. # usage: site/assemble.sh [commit] # Anything that wasn't built is simply left off the page, so this also works on a partial local build. set -eu root=$(cd "$(dirname "$0")/.." && pwd) out=${1:?usage: assemble.sh [commit]} commit=${2:-unknown} mkdir -p "$out" case $(uname -m) in x86_64|amd64) arch=x64 ;; aarch64|arm64) arch=arm64 ;; *) arch=$(uname -m) ;; esac sha() { if command -v sha256sum >/dev/null 2>&1; then sha256sum "$@"; else shasum -a 256 "$@"; fi; } size() { du -h "$1" | cut -f1 | tr -d ' '; } apk=$root/android/build/outputs/apk/release/android-release.apk jar=$root/desktop/build/libs/rookery-universal.jar app=$root/desktop/build/compose/binaries/main/app/rookery [ -f "$apk" ] && cp "$apk" "$out/rookery-android.apk" [ -f "$jar" ] && cp "$jar" "$out/rookery.jar" cp "$root"/site/assets/*.png "$out/" for z in "$root"/desktop/build/macos/rookery-macos-*.zip; do [ -f "$z" ] && cp "$z" "$out/"; done [ -d "$app" ] && tar -C "$(dirname "$app")" -czf "$out/rookery-linux-$arch.tar.gz" rookery printf '%s\n' "$commit" > "$out/commit.txt" (cd "$out" && sha rookery* > SHA256SUMS) row() { # file, description [ -f "$out/$1" ] && printf '%s%s%s\n' "$1" "$1" "$2" "$(size "$out/$1")" return 0 } short=$(printf '%.7s' "$commit") if [ "$commit" = unknown ]; then rev="$short"; else rev="$short"; fi built=$(date -u +"%Y-%m-%d %H:%M UTC") cat > "$out/index.html" < rookery

rookery

speedcubing timer and blindfold trainer. desktop and android.


downloads

$(row rookery-macos-arm64.zip "macOS 11+, Apple Silicon, not notarized") $(row rookery-macos-x64.zip "macOS 11+, Intel, not notarized") $(row rookery-android.apk "Android 8+, release build (debug-signed)") $(row "rookery-linux-$arch.tar.gz" "Linux $arch, runtime included") $(row rookery.jar "Java 21; Linux, macOS, Windows")

build $rev, $built

HTML echo "site: $(ls "$out" | tr '\n' ' ')"