| 1 | #!/bin/sh |
| 2 | # release-dist.sh - thin wrapper around the shared multi-arch release tool. |
| 3 | # |
| 4 | # The real cross-target build + dist publish lives in scorpiox-cli-botplugin |
| 5 | # (it owns the musl / aarch64 / MinGW / macOS toolchains, the dist upload and |
| 6 | # the plugingit mirror). This script exists so the repo releases the same way |
| 7 | # every other oss plugin does, and so a stale release fails loudly instead of |
| 8 | # shipping a 3-target manifest that still says "release complete". |
| 9 | # |
| 10 | # ./release-dist.sh # build + publish the default version |
| 11 | # VERSION=1.0.1 ./release-dist.sh # explicit version |
| 12 | # |
| 13 | # Run it on the build host that has musl-gcc, aarch64-linux-gnu-gcc, |
| 14 | # x86_64-w64-mingw32-gcc and ssh access to the macOS builder. |
| 15 | |
| 16 | set -eu |
| 17 | |
| 18 | SLUG=filesystem |
| 19 | VERSION="${VERSION:-1.0.1}" |
| 20 | PLUGINGIT_TOKEN_FILE="${PLUGINGIT_TOKEN_FILE:-/etc/scorpiox-plugingit.token}" |
| 21 | |
| 22 | ROOT=$(cd "$(dirname "$0")" && pwd) |
| 23 | |
| 24 | if ! command -v scorpiox-cli-botplugin >/dev/null 2>&1; then |
| 25 | echo "scorpiox-cli-botplugin not found on PATH" >&2 |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
| 29 | echo "==> audit $SLUG" |
| 30 | scorpiox-cli-botplugin audit "$ROOT" --json || { echo "audit blocked the release" >&2; exit 4; } |
| 31 | |
| 32 | echo "==> publish $SLUG $VERSION" |
| 33 | scorpiox-cli-botplugin publish "$ROOT" \ |
| 34 | --slug "$SLUG" \ |
| 35 | --version "$VERSION" \ |
| 36 | --macos-host "${MACOS_HOST:-yongchen@macos-builder}" \ |
| 37 | --json |
| 38 | |
| 39 | echo "==> reindex" |
| 40 | scorpiox-cli-botplugin reindex --json >/dev/null 2>&1 || true |
| 41 | echo "check dist/bot-plugins/$SLUG/$VERSION/manifest.json has 6 targets before calling it done" |