/ opencodehub / scripts / publish-cli.sh
swadhinbiswas feat: OpenCodeHub v1.1.0 - Enterprise Features & Storage Adapters Β· 2/15/2026
719a1cb
37 lines Β· 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash

# Publish CLI to npm and other registries
set -e

echo "πŸš€ Preparing to publish OpenCodeHub CLI..."

# Move to CLI directory
cd cli

# 1. Clean and Build
echo "πŸ“¦ Building..."
bun install
bun run build

# 2. Verify
echo "βœ… Verifying..."
bun run test
# bun doesn't have 'pack' yet, using npm for verification only if strict, otherwise skip or keep npm just for this.
# Keeping npm pack for dry-run verification as it's standard.
npm pack --dry-run

# 3. Check Authentication
echo "πŸ”‘ Checking npm authentication..."
if ! npm whoami &> /dev/null; then
  echo "❌ You are not logged in to npm."
  echo "πŸ‘‰ Run 'npm login' first."
  exit 1
fi

# 4. Publish
echo "πŸš€ Publishing to npm..."
# Note: Remove --dry-run to actually publish
bun publish --access public

echo "πŸŽ‰ Published successfully!"