Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit fe17f05

Browse files
committed
...
1 parent cbce123 commit fe17f05

File tree

3 files changed

+312
-37
lines changed

3 files changed

+312
-37
lines changed

.github/workflows/release-osx.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
on:
22
push:
3-
# Sequence of patterns matched against refs/tags
4-
tags:
5-
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
3+
branches:
4+
- development_herocode
65

76
name: Create OSX Release
87

98
jobs:
109
create-release:
1110
name: Create Release
12-
runs-on: ubuntu-latest
11+
runs-on: macos-latest
1312
outputs:
1413
upload_url: ${{ steps.create_release.outputs.upload_url }}
1514
steps:

osx_build.sh

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#!/bin/bash
2+
3+
# Jump to the directory of the script
4+
cd "$(dirname "$0")"
5+
6+
# Function to kill zinit and its children
7+
kill_zinit() {
8+
echo "Checking for running zinit processes..."
9+
10+
# Find zinit processes
11+
ZINIT_PIDS=$(pgrep -f "zinit" 2>/dev/null)
12+
13+
if [ -n "$ZINIT_PIDS" ]; then
14+
echo "Found zinit processes: $ZINIT_PIDS"
15+
16+
# Kill children first, then parent processes
17+
for pid in $ZINIT_PIDS; do
18+
echo "Killing zinit process $pid and its children..."
19+
# Kill process tree (parent and children)
20+
pkill -TERM -P $pid 2>/dev/null
21+
kill -TERM $pid 2>/dev/null
22+
done
23+
24+
# Wait a moment for graceful shutdown
25+
sleep 2
26+
27+
# Force kill if still running
28+
REMAINING_PIDS=$(pgrep -f "zinit" 2>/dev/null)
29+
if [ -n "$REMAINING_PIDS" ]; then
30+
echo "Force killing remaining zinit processes..."
31+
for pid in $REMAINING_PIDS; do
32+
pkill -KILL -P $pid 2>/dev/null
33+
kill -KILL $pid 2>/dev/null
34+
done
35+
fi
36+
37+
echo "Zinit processes terminated."
38+
else
39+
echo "No running zinit processes found."
40+
fi
41+
}
42+
43+
# Kill any existing zinit processes
44+
kill_zinit
45+
46+
# Build the project
47+
echo "Building zinit..."
48+
cargo build --release
49+
50+
if [ $? -ne 0 ]; then
51+
echo "Build failed!"
52+
exit 1
53+
fi
54+
55+
# Copy the binary
56+
echo "Copying zinit binary to ~/hero/bin..."
57+
cp ./target/release/zinit ~/hero/bin
58+
59+
if [ $? -ne 0 ]; then
60+
echo "Failed to copy binary!"
61+
exit 1
62+
fi
63+
64+
# Ensure config directory exists
65+
echo "Ensuring config directory exists..."
66+
mkdir -p ~/hero/cfg/zinit
67+
68+
# Start zinit in init mode (daemon) in background
69+
echo "Starting zinit daemon in background..."
70+
~/hero/bin/zinit init -c ~/hero/cfg/zinit &
71+
ZINIT_PID=$!
72+
73+
# Wait a moment for zinit to start and create the socket
74+
sleep 5
75+
76+
# Check if zinit is running
77+
if kill -0 $ZINIT_PID 2>/dev/null; then
78+
echo "Zinit daemon started successfully with PID: $ZINIT_PID"
79+
80+
# Test with zinit list
81+
echo "Testing zinit list command..."
82+
~/hero/bin/zinit list
83+
84+
if [ $? -eq 0 ]; then
85+
echo "Zinit is working correctly!"
86+
else
87+
echo "Warning: zinit list command failed, but zinit daemon is running"
88+
echo "This might be normal if no services are configured yet."
89+
fi
90+
else
91+
echo "Failed to start zinit daemon!"
92+
exit 1
93+
fi
94+
95+
echo "Build and setup completed successfully!"

0 commit comments

Comments
 (0)