Skip to content

Commit 978af3e

Browse files
committed
ci: correct build output paths and add rpm support
1 parent 81a7a57 commit 978af3e

File tree

3 files changed

+87
-31
lines changed

3 files changed

+87
-31
lines changed

.github/workflows/pages-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ jobs:
77
deploy:
88
runs-on: ubuntu-latest
99
name: Deploy to Cloudflare Pages
10+
permissions:
11+
contents: read
12+
deployments: write
1013
steps:
1114
- uses: actions/checkout@v6
1215
with:

.github/workflows/release.yml

Lines changed: 83 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
if: runner.os == 'Linux'
6262
run: |
6363
sudo apt-get update
64-
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
64+
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev rpm
6565
6666
- uses: pnpm/action-setup@v4
6767
with:
@@ -178,60 +178,112 @@ jobs:
178178
run: |
179179
VERSION=${GITHUB_REF#refs/tags/v}
180180
echo "Processing assets for $PLATFORM ($ARCH)..."
181+
echo "Version: $VERSION"
181182
182183
mkdir -p upload_dist
183184
184185
if [[ "${{ matrix.args }}" == *"--target"* ]]; then
185-
BASE_DIR="pearl_calculator_ui/src-tauri/target/$TARGET/release"
186+
BASE_DIR="target/$TARGET/release"
186187
else
187-
BASE_DIR="pearl_calculator_ui/src-tauri/target/release"
188+
BASE_DIR="target/release"
188189
fi
189190
190191
echo "Base Directory: $BASE_DIR"
191192
192-
process_file() {
193-
local src=$1
194-
local type=$2
195-
local ext=$3
196-
197-
if [ -f "$src" ]; then
198-
local new_name="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_${type}.${ext}"
199-
echo "Found $type: $src -> $new_name"
200-
cp "$src" "upload_dist/$new_name"
201-
else
202-
echo "Checking for $src... NOT FOUND"
203-
fi
204-
}
193+
echo "=== Bundle Directory Contents ==="
194+
if [ -d "$BASE_DIR/bundle" ]; then
195+
ls -laR "$BASE_DIR/bundle" || true
196+
else
197+
echo "ERROR: Bundle directory does not exist: $BASE_DIR/bundle"
198+
echo "=== Checking parent directory ==="
199+
ls -la "$BASE_DIR" || true
200+
exit 1
201+
fi
202+
echo "================================="
205203
206204
# Windows
207205
if [[ "$PLATFORM" == "windows" ]]; then
208-
process_file "$BASE_DIR/bundle/nsis/Pearl Calculator RS_${VERSION}_${ARCH}-setup.exe" "setup" "exe"
209-
process_file "$BASE_DIR/pearl_calculator_ui.exe" "portable" "exe"
206+
echo "Looking for Windows assets..."
207+
# Find NSIS installer (filename varies by architecture naming)
208+
NSIS_FILE=$(find "$BASE_DIR/bundle/nsis" -name "*.exe" -type f 2>/dev/null | head -n 1)
209+
if [ -n "$NSIS_FILE" ]; then
210+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_setup.exe"
211+
echo "Found NSIS: $NSIS_FILE -> $NEW_NAME"
212+
cp "$NSIS_FILE" "upload_dist/$NEW_NAME"
213+
else
214+
echo "WARNING: No NSIS installer found"
215+
fi
216+
217+
# Portable exe
218+
PORTABLE="$BASE_DIR/pearl_calculator_ui.exe"
219+
if [ -f "$PORTABLE" ]; then
220+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_portable.exe"
221+
echo "Found portable: $PORTABLE -> $NEW_NAME"
222+
cp "$PORTABLE" "upload_dist/$NEW_NAME"
223+
else
224+
echo "WARNING: No portable exe found at $PORTABLE"
225+
fi
210226
fi
211227
212228
# Linux
213229
if [[ "$PLATFORM" == "linux" ]]; then
214-
find "$BASE_DIR/bundle/appimage" -name "*.AppImage" 2>/dev/null | while read -r file; do
215-
process_file "$file" "appimage" "AppImage"
216-
done
217-
find "$BASE_DIR/bundle/deb" -name "*.deb" 2>/dev/null | while read -r file; do
218-
process_file "$file" "installer" "deb"
219-
done
230+
echo "Looking for Linux assets..."
231+
# AppImage
232+
APPIMAGE=$(find "$BASE_DIR/bundle/appimage" -name "*.AppImage" -type f 2>/dev/null | head -n 1)
233+
if [ -n "$APPIMAGE" ]; then
234+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_appimage.AppImage"
235+
echo "Found AppImage: $APPIMAGE -> $NEW_NAME"
236+
cp "$APPIMAGE" "upload_dist/$NEW_NAME"
237+
else
238+
echo "WARNING: No AppImage found"
239+
fi
240+
241+
# Deb
242+
DEB=$(find "$BASE_DIR/bundle/deb" -name "*.deb" -type f 2>/dev/null | head -n 1)
243+
if [ -n "$DEB" ]; then
244+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_installer.deb"
245+
echo "Found deb: $DEB -> $NEW_NAME"
246+
cp "$DEB" "upload_dist/$NEW_NAME"
247+
else
248+
echo "WARNING: No deb found"
249+
fi
250+
251+
# RPM
252+
RPM=$(find "$BASE_DIR/bundle/rpm" -name "*.rpm" -type f 2>/dev/null | head -n 1)
253+
if [ -n "$RPM" ]; then
254+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_installer.rpm"
255+
echo "Found rpm: $RPM -> $NEW_NAME"
256+
cp "$RPM" "upload_dist/$NEW_NAME"
257+
else
258+
echo "WARNING: No rpm found"
259+
fi
220260
fi
221261
222262
# macOS
223263
if [[ "$PLATFORM" == "macos" ]]; then
224-
find "$BASE_DIR/bundle/dmg" -name "*.dmg" 2>/dev/null | while read -r file; do
225-
process_file "$file" "installer" "dmg"
226-
done
264+
echo "Looking for macOS assets..."
265+
DMG=$(find "$BASE_DIR/bundle/dmg" -name "*.dmg" -type f 2>/dev/null | head -n 1)
266+
if [ -n "$DMG" ]; then
267+
NEW_NAME="Pearl-Calculator-RS_${VERSION}_${PLATFORM}_${ARCH}_installer.dmg"
268+
echo "Found dmg: $DMG -> $NEW_NAME"
269+
cp "$DMG" "upload_dist/$NEW_NAME"
270+
else
271+
echo "WARNING: No dmg found"
272+
fi
227273
fi
228274
229-
# Upload
230-
if [ "$(ls -A upload_dist)" ]; then
275+
# Upload - FAIL if no assets found
276+
echo "=== Upload Directory Contents ==="
277+
ls -la upload_dist/
278+
echo "================================="
279+
280+
if [ "$(ls -A upload_dist 2>/dev/null)" ]; then
281+
echo "Uploading assets to release $TAG_NAME..."
231282
gh release upload "$TAG_NAME" upload_dist/* --clobber
283+
echo "✅ Upload complete!"
232284
else
233-
echo "⚠️ No assets found to upload for $PLATFORM-$ARCH"
234-
ls -R "$BASE_DIR/bundle" || true
285+
echo "❌ ERROR: No assets found to upload for $PLATFORM-$ARCH"
286+
exit 1
235287
fi
236288
237289
deploy-pages:

pearl_calculator_ui/src-tauri/tauri.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"nsis",
3030
"appimage",
3131
"deb",
32+
"rpm",
3233
"dmg",
3334
"app"
3435
],

0 commit comments

Comments
 (0)