Files
openhuman/scripts/release/package-cli-tarball.sh
88a4647dae refactor: extract release workflow inline bash into modular scripts (#175)
Split monolithic inline bash from release.yml and release-packages.yml
into standalone scripts under scripts/release/ for easier debugging
and manual execution.

New scripts:
- bump-version.js: version bumping across package.json/tauri/Cargo
- stage-sidecar.sh: stage + verify sidecar binary for Tauri bundler
- sign-and-notarize-macos.sh: macOS code signing and notarization
- repackage-dmg.sh: re-create and notarize DMG post-signing
- upload-macos-artifacts.sh: re-upload notarized artifacts to release
- package-cli-tarball.sh: package CLI binary into release tarball
- build-linux-arm64.sh: build Linux arm64 CLI tarball
- update-homebrew.sh: render and commit Homebrew formula to tap
- build-apt-packages.sh: build .deb packages and apt repository
- publish-npm.sh: stamp version and publish npm package

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:13:11 -07:00

41 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Package the core CLI binary into a release tarball and optionally upload it.
#
# Usage:
# package-cli-tarball.sh <binary_path> <version> <target>
#
# Environment:
# GITHUB_TOKEN — if set, uploads tarball + sha256 to the GitHub release
# UPLOAD_REPO — GitHub repo slug (default: tinyhumansai/openhuman)
#
# Example:
# package-cli-tarball.sh target/release/openhuman-core 0.5.0 aarch64-apple-darwin
set -euo pipefail
BIN_PATH="${1:?Usage: package-cli-tarball.sh <binary_path> <version> <target>}"
VERSION="${2:?}"
TARGET="${3:?}"
UPLOAD_REPO="${UPLOAD_REPO:-tinyhumansai/openhuman}"
TARBALL="openhuman-core-${VERSION}-${TARGET}.tar.gz"
WORK=$(mktemp -d)
trap 'rm -rf "$WORK"' EXIT
cp "$BIN_PATH" "$WORK/openhuman-core"
chmod +x "$WORK/openhuman-core"
tar -czf "$TARBALL" -C "$WORK" openhuman-core
# openssl dgst works on both macOS and Linux
openssl dgst -sha256 -r "$TARBALL" | awk '{print $1}' > "${TARBALL}.sha256"
echo "[package-cli] Created $TARBALL (sha256: $(cat "${TARBALL}.sha256"))"
# ── Optional upload ──────────────────────────────────────────────────────────
if [[ -n "${GITHUB_TOKEN:-}" ]]; then
gh release upload "v${VERSION}" \
"$TARBALL" "${TARBALL}.sha256" \
--repo "$UPLOAD_REPO" --clobber
echo "[package-cli] Uploaded $TARBALL to v${VERSION}"
fi