Skip to content

Commit 027d4c0

Browse files
committed
Fixing release
1 parent e2e2559 commit 027d4c0

File tree

2 files changed

+47
-9
lines changed

2 files changed

+47
-9
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
version: latest
3030
args: release --clean
3131
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
3333

3434
- name: Update Homebrew tap
3535
if: success()
3636
uses: dawidd6/action-homebrew-bump-formula@v3
3737
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
38+
token: ${{ secrets.GH_PAT }}
3939
tap: scalvert/homebrew-tap
4040
formula: glean-cli
4141
tag: ${{ github.ref_name }}

install.sh

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,57 @@ trap cleanup EXIT
3131

3232
# Download and extract
3333
echo "Downloading Glean CLI ${LATEST_VERSION}..."
34+
echo "Download URL: $DOWNLOAD_URL"
3435
curl -fsSL "$DOWNLOAD_URL" -o "$TMP_DIR/glean.tar.gz"
36+
37+
echo "Extracting archive..."
38+
tar -tvf "$TMP_DIR/glean.tar.gz"
3539
tar -xzf "$TMP_DIR/glean.tar.gz" -C "$TMP_DIR"
3640

41+
echo "Verifying extracted contents..."
42+
ls -la "$TMP_DIR"
43+
3744
# Install binary
3845
INSTALL_DIR="/usr/local/bin"
39-
if [ ! -w "$INSTALL_DIR" ]; then
40-
echo "Installing Glean CLI requires sudo access to $INSTALL_DIR"
41-
sudo mv "$TMP_DIR/glean" "$INSTALL_DIR/"
42-
sudo chmod +x "$INSTALL_DIR/glean"
43-
else
44-
mv "$TMP_DIR/glean" "$INSTALL_DIR/"
46+
47+
# Create install directory if it doesn't exist
48+
if [ ! -d "$INSTALL_DIR" ]; then
49+
echo "Creating $INSTALL_DIR directory..."
50+
if ! sudo mkdir -p "$INSTALL_DIR"; then
51+
echo "Failed to create $INSTALL_DIR"
52+
exit 1
53+
fi
54+
fi
55+
56+
# Set proper ownership for /usr/local/bin if it was just created
57+
if [ -d "$INSTALL_DIR" ]; then
58+
sudo chown -R $(whoami) "$INSTALL_DIR" 2>/dev/null || true
59+
fi
60+
61+
# Find the glean binary
62+
GLEAN_BINARY=$(find "$TMP_DIR" -type f -name "glean" -o -name "glean.exe" | head -n 1)
63+
64+
if [ -z "$GLEAN_BINARY" ]; then
65+
echo "Error: Could not find glean binary in extracted files"
66+
echo "Contents of temp directory:"
67+
ls -R "$TMP_DIR"
68+
exit 1
69+
fi
70+
71+
# Attempt installation
72+
echo "Installing to $INSTALL_DIR..."
73+
echo "Installing $GLEAN_BINARY to $INSTALL_DIR/glean"
74+
75+
if [ -w "$INSTALL_DIR" ]; then
76+
# We have write permission
77+
mv "$GLEAN_BINARY" "$INSTALL_DIR/glean"
4578
chmod +x "$INSTALL_DIR/glean"
79+
else
80+
# We need sudo
81+
echo "Elevated permissions required for installation..."
82+
sudo mv "$GLEAN_BINARY" "$INSTALL_DIR/glean"
83+
sudo chmod +x "$INSTALL_DIR/glean"
4684
fi
4785

48-
echo "Glean CLI has been installed to $INSTALL_DIR/glean"
86+
echo "Glean CLI ${LATEST_VERSION} has been installed to $INSTALL_DIR/glean"
4987
echo "Run 'glean --help' to get started"

0 commit comments

Comments
 (0)