tui: set up for publishing via github actions (#8020)

This commit is contained in:
Alex Hancock
2026-03-23 13:21:20 -04:00
committed by GitHub
parent c493c6160c
commit 997f27ef33
39 changed files with 3143 additions and 7192 deletions
+14 -14
View File
@@ -1,19 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
# Publishes @block/goose-acp, @block/goose, and all native binary packages to npm.
# Publishes @aaif/goose-acp, @aaif/goose, and all native binary packages to npm.
#
# Usage:
# ./ui/scripts/publish.sh # publish all (dry-run)
# ./ui/scripts/publish.sh --real # publish for real
#
# Prerequisites:
# - npm login to the @block scope
# - Native binaries built via build-native-packages.sh
# - npm login to the @aaif scope
# - Native binaries built via npm run build:native:all in ui/acp
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
NPM_DIR="${REPO_ROOT}/npm"
ACP_DIR="${REPO_ROOT}/ui/acp"
NATIVE_DIR="${REPO_ROOT}/ui/goose-acp-server"
TEXT_DIR="${REPO_ROOT}/ui/text"
DRY_RUN="--dry-run"
@@ -24,15 +24,15 @@ else
echo "==> Dry run (pass --real to publish)"
fi
# Build and publish @block/goose-acp first (dependency of @block/goose)
echo "==> Building @block/goose-acp"
# Build and publish @aaif/goose-acp first (dependency of @aaif/goose)
echo "==> Building @aaif/goose-acp"
(cd "${ACP_DIR}" && npm run build)
echo "==> Publishing @block/goose-acp"
echo "==> Publishing @aaif/goose-acp"
(cd "${ACP_DIR}" && npm publish --access public ${DRY_RUN})
# Build @block/goose
echo "==> Building @block/goose"
# Build @aaif/goose
echo "==> Building @aaif/goose"
(cd "${TEXT_DIR}" && npm run build)
NATIVE_PACKAGES=(
@@ -45,19 +45,19 @@ NATIVE_PACKAGES=(
# Publish native binary packages
for pkg in "${NATIVE_PACKAGES[@]}"; do
pkg_dir="${NPM_DIR}/${pkg}"
pkg_dir="${NATIVE_DIR}/${pkg}"
if [ ! -f "${pkg_dir}/bin/goose" ] && [ ! -f "${pkg_dir}/bin/goose.exe" ]; then
echo " SKIP ${pkg} (no binary found — run build-native-packages.sh first)"
if [ ! -f "${pkg_dir}/bin/goose-acp-server" ] && [ ! -f "${pkg_dir}/bin/goose-acp-server.exe" ]; then
echo " SKIP ${pkg} (no binary found — run npm run build:native:all in ui/acp first)"
continue
fi
echo "==> Publishing @block/${pkg}"
echo "==> Publishing @aaif/${pkg}"
(cd "${pkg_dir}" && npm publish --access public ${DRY_RUN})
done
# Publish the main package
echo "==> Publishing @block/goose"
echo "==> Publishing @aaif/goose"
(cd "${TEXT_DIR}" && npm publish --access public ${DRY_RUN})
echo "==> Done"