scorpiox-bot-plugin-github
←release-dist.shbash
41 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 5-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.
16
17set -eu
18
19SLUG=github
20VERSION="${VERSION:-1.0.0}"
21PLUGINGIT_TOKEN_FILE="${PLUGINGIT_TOKEN_FILE:-/etc/scorpiox-plugingit.token}"
22
23ROOT=$(cd "$(dirname "$0")" && pwd)
24
25if ! command -v scorpiox-cli-botplugin >/dev/null 2>&1; then
26 echo "scorpiox-cli-botplugin not found on PATH" >&2
27 exit 1
28fi
29
30echo "==> audit $SLUG"
31scorpiox-cli-botplugin audit "$ROOT" --json || { echo "audit blocked the release" >&2; exit 4; }
32
33echo "==> publish $SLUG $VERSION"
34scorpiox-cli-botplugin publish "$ROOT" \
35 --slug "$SLUG" \
36 --version "$VERSION" \
37 --json
38
39echo "==> reindex"
40scorpiox-cli-botplugin reindex --json >/dev/null 2>&1 || true
41echo "check dist/bot-plugins/$SLUG/$VERSION/manifest.json has 6 targets before calling it done"