scorpiox-bot-plugin-fetch
←release-dist.shbash
43 lines · 1 KBHEADBlameDownload
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 version in plugin.json
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. Nothing here
15# contains a host address or a credential: the macOS builder and the dist
16# target come from the environment / the CLI's own configuration.
17
18set -eu
19
20SLUG=fetch
21VERSION="${VERSION:-1.0.0}"
22PLUGINGIT_TOKEN_FILE="${PLUGINGIT_TOKEN_FILE:-/etc/scorpiox-plugingit.token}"
23
24ROOT=$(cd "$(dirname "$0")" && pwd)
25
26if ! command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
27 echo "scorpiox-cli-botplugin not found on PATH" >&2
28 exit 1
29fi
30
31echo "==> audit $SLUG"
32scorpiox-cli-botplugin audit "$ROOT" --json || { echo "audit blocked the release" >&2; exit 4; }
33
34echo "==> publish $SLUG $VERSION"
35scorpiox-cli-botplugin publish "$ROOT" \
36 --slug "$SLUG" \
37 --version "$VERSION" \
38 --macos-host "${MACOS_HOST:-macos-builder}" \
39 --json
40
41echo "==> reindex"
42scorpiox-cli-botplugin reindex --json >/dev/null 2>&1 || true
43echo "check dist/bot-plugins/$SLUG/$VERSION/manifest.json has 6 targets before calling it done"