Files
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

35 lines
925 B
Bash
Executable File

#!/usr/bin/env bash
# Publish the openhuman npm package for a given version.
#
# Usage:
# publish-npm.sh <tag>
#
# Required environment:
# NODE_AUTH_TOKEN — npm automation token
#
# Optional environment:
# DRY_RUN — set to "true" to run npm publish --dry-run
set -euo pipefail
TAG="${1:?Usage: publish-npm.sh <tag>}"
VERSION="${TAG#v}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$REPO_ROOT/packages/npm"
# Stamp version without creating a git commit
npm version "$VERSION" --no-git-tag-version
PUBLISH_ARGS=(--access public)
if [[ "${DRY_RUN:-}" == "true" ]]; then
PUBLISH_ARGS+=(--dry-run)
fi
# SKIP_OPENHUMAN_BINARY_DOWNLOAD prevents postinstall from running
# during publish (the binary doesn't exist yet on the publish runner)
SKIP_OPENHUMAN_BINARY_DOWNLOAD=1 npm publish "${PUBLISH_ARGS[@]}"
echo "[npm] Published openhuman@${VERSION}"