Skip to content

Commit 03e188f

Browse files
committed
fix CI
1 parent f747563 commit 03e188f

2 files changed

Lines changed: 30 additions & 31 deletions

File tree

.github/workflows/test.yml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,31 @@ jobs:
5353
echo "Listing dist directory..."
5454
ls -la dist/
5555
56-
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const linux=build.linux||{}; console.log(linux.executableName || build.productName || pkg.name)")
56+
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const linux=build.linux||{}; (linux.executableName || build.productName || pkg.name)")
5757
echo "Expected app name: $APP_NAME"
5858
59-
# Try unpacked directory first (more reliable for testing)
59+
echo "Testing AppImage startup..."
60+
APPIMAGE=$(find dist -name "*.AppImage" | head -n 1)
61+
if [ -n "$APPIMAGE" ]; then
62+
echo "Found AppImage: $APPIMAGE"
63+
chmod +x "$APPIMAGE"
64+
# Use --appimage-extract-and-run to avoid FUSE requirement in CI
65+
timeout 15s "$APPIMAGE" --appimage-extract-and-run --no-sandbox &
66+
APP_PID=$!
67+
sleep 5
68+
if kill -0 $APP_PID 2>/dev/null; then
69+
echo "✓ App started successfully"
70+
kill $APP_PID 2>/dev/null || true
71+
pkill -P $APP_PID 2>/dev/null || true
72+
pkill -f ipfs 2>/dev/null || true
73+
exit 0
74+
else
75+
echo "✗ App failed to start"
76+
exit 1
77+
fi
78+
fi
79+
80+
# Fallback to linux-unpacked if AppImage isn't present
6081
if [ -d "dist/linux-unpacked" ]; then
6182
echo "Testing unpacked executable..."
6283
# Look for the app executable by name (excludes .so libraries)
@@ -91,26 +112,6 @@ jobs:
91112
fi
92113
fi
93114
94-
# Fallback to AppImage
95-
APPIMAGE=$(find dist -name "*.AppImage" | head -n 1)
96-
if [ -n "$APPIMAGE" ]; then
97-
echo "Found AppImage: $APPIMAGE"
98-
chmod +x "$APPIMAGE"
99-
"$APPIMAGE" --appimage-extract-and-run --no-sandbox &
100-
APP_PID=$!
101-
sleep 10
102-
if kill -0 $APP_PID 2>/dev/null; then
103-
echo "✓ App started successfully"
104-
kill $APP_PID 2>/dev/null || true
105-
pkill -P $APP_PID 2>/dev/null || true
106-
pkill -f ipfs 2>/dev/null || true
107-
exit 0
108-
else
109-
echo "✗ App failed to start or crashed"
110-
exit 1
111-
fi
112-
fi
113-
114115
echo "✗ No runnable artifact found"
115116
ls -R dist/
116117
exit 1
@@ -168,7 +169,7 @@ jobs:
168169
echo "Listing dist directory..."
169170
ls -la dist/
170171
171-
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const mac=build.mac||{}; console.log(mac.executableName || build.productName || pkg.name)")
172+
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const mac=build.mac||{}; (mac.executableName || build.productName || pkg.name)")
172173
echo "Expected app name: $APP_NAME"
173174
174175
# Find .app bundle in dist/mac/
@@ -272,7 +273,7 @@ jobs:
272273
echo "Listing dist directory..."
273274
ls -la dist/
274275
275-
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const mac=build.mac||{}; console.log(mac.executableName || build.productName || pkg.name)")
276+
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const mac=build.mac||{}; (mac.executableName || build.productName || pkg.name)")
276277
echo "Expected app name: $APP_NAME"
277278
278279
# Find .app bundle in dist/mac-arm64/ or dist/mac/
@@ -378,7 +379,7 @@ jobs:
378379
echo "Listing dist directory..."
379380
ls -la dist/
380381
381-
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const win=build.win||{}; console.log(win.executableName || build.productName || pkg.name)")
382+
APP_NAME=$(node -p "const pkg=require('./package.json'); const build=pkg.build||{}; const win=build.win||{}; (win.executableName || build.productName || pkg.name)")
382383
echo "Expected app name: $APP_NAME"
383384
384385
# Try to find the unpacked executable
@@ -401,14 +402,12 @@ jobs:
401402
fi
402403
if [ -f "$EXE" ]; then
403404
echo "Testing: $EXE"
404-
"$EXE" &
405+
timeout 15s "$EXE" &
405406
APP_PID=$!
406-
sleep 10
407-
EXE_BASENAME=$(basename "$EXE")
408-
if kill -0 $APP_PID 2>/dev/null || tasklist //FI "IMAGENAME eq $EXE_BASENAME" 2>/dev/null | findstr /I "$EXE_BASENAME" > /dev/null; then
407+
sleep 8
408+
if kill -0 $APP_PID 2>/dev/null; then
409409
echo "✓ App started successfully"
410410
taskkill //F //PID $APP_PID 2>/dev/null || true
411-
taskkill //F //IM "$EXE_BASENAME" 2>/dev/null || true
412411
taskkill //F //IM ipfs.exe 2>/dev/null || true
413412
exit 0
414413
else

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Seedit",
2+
"name": "seedit",
33
"version": "0.5.10",
44
"description": "A bitsocial client with an old.reddit UI",
55
"author": "Bitsocial Labs",

0 commit comments

Comments
 (0)