|
61 | 61 | if: runner.os == 'Linux' |
62 | 62 | run: | |
63 | 63 | 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 |
65 | 65 |
|
66 | 66 | - uses: pnpm/action-setup@v4 |
67 | 67 | with: |
@@ -178,60 +178,112 @@ jobs: |
178 | 178 | run: | |
179 | 179 | VERSION=${GITHUB_REF#refs/tags/v} |
180 | 180 | echo "Processing assets for $PLATFORM ($ARCH)..." |
| 181 | + echo "Version: $VERSION" |
181 | 182 | |
182 | 183 | mkdir -p upload_dist |
183 | 184 |
|
184 | 185 | if [[ "${{ matrix.args }}" == *"--target"* ]]; then |
185 | | - BASE_DIR="pearl_calculator_ui/src-tauri/target/$TARGET/release" |
| 186 | + BASE_DIR="target/$TARGET/release" |
186 | 187 | else |
187 | | - BASE_DIR="pearl_calculator_ui/src-tauri/target/release" |
| 188 | + BASE_DIR="target/release" |
188 | 189 | fi |
189 | 190 | |
190 | 191 | echo "Base Directory: $BASE_DIR" |
191 | 192 |
|
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 "=================================" |
205 | 203 |
|
206 | 204 | # Windows |
207 | 205 | 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 |
210 | 226 | fi |
211 | 227 |
|
212 | 228 | # Linux |
213 | 229 | 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 |
220 | 260 | fi |
221 | 261 |
|
222 | 262 | # macOS |
223 | 263 | 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 |
227 | 273 | fi |
228 | 274 |
|
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..." |
231 | 282 | gh release upload "$TAG_NAME" upload_dist/* --clobber |
| 283 | + echo "✅ Upload complete!" |
232 | 284 | 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 |
235 | 287 | fi |
236 | 288 |
|
237 | 289 | deploy-pages: |
|
0 commit comments