mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-13 09:20:29 +00:00
fix: Ensure optional artifact absence does not fail the build step
This commit is contained in:
18
.github/workflows/build-multiplatform.yml
vendored
18
.github/workflows/build-multiplatform.yml
vendored
@@ -562,10 +562,10 @@ jobs:
|
|||||||
local dest_name="$3"
|
local dest_name="$3"
|
||||||
local platform="$4"
|
local platform="$4"
|
||||||
|
|
||||||
# Check if directory exists first
|
# Check if directory exists first; don't fail the whole step if missing.
|
||||||
if [ ! -d "$search_dir" ]; then
|
if [ ! -d "$search_dir" ]; then
|
||||||
echo "⚠️ Skipping $platform: Directory $search_dir not found (build may have been skipped)"
|
echo "⚠️ Skipping $platform: Directory $search_dir not found (build may have been skipped)"
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find the file matching the pattern
|
# Find the file matching the pattern
|
||||||
@@ -573,18 +573,18 @@ jobs:
|
|||||||
|
|
||||||
if [ -n "$src_file" ] && [ -f "$src_file" ]; then
|
if [ -n "$src_file" ] && [ -f "$src_file" ]; then
|
||||||
echo "✅ Copying $platform: $src_file"
|
echo "✅ Copying $platform: $src_file"
|
||||||
cp "$src_file" \
|
cp "$src_file" "r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}/$dest_name" || true
|
||||||
"r2-upload/unstable/${{ steps.metadata.outputs.build_prefix }}/$dest_name"
|
|
||||||
|
|
||||||
if [ "${{ steps.metadata.outputs.branch_name }}" == "main" ]; then
|
if [ "${{ steps.metadata.outputs.branch_name }}" == "main" ]; then
|
||||||
local latest_name="${dest_name/${{ steps.metadata.outputs.build_prefix }}-${{ steps.metadata.outputs.timestamp }}/latest}"
|
# Copy the same dest filename into the 'latest' folder for simplicity
|
||||||
cp "$src_file" "r2-upload/unstable/latest/$latest_name"
|
cp "$src_file" "r2-upload/unstable/latest/$dest_name" || true
|
||||||
fi
|
fi
|
||||||
return 0
|
|
||||||
else
|
else
|
||||||
echo "⚠️ Skipping $platform: No file matching '$pattern' found in $search_dir"
|
echo "⚠️ Skipping $platform: No file matching '$pattern' found in $search_dir"
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Always succeed (so missing optional artifacts don't fail the whole job)
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Copy Android APK (search for any .apk file)
|
# Copy Android APK (search for any .apk file)
|
||||||
@@ -615,6 +615,8 @@ jobs:
|
|||||||
"meshcore-sar-${{ steps.metadata.outputs.build_prefix }}-${{ steps.metadata.outputs.timestamp }}-windows.zip" \
|
"meshcore-sar-${{ steps.metadata.outputs.build_prefix }}-${{ steps.metadata.outputs.timestamp }}-windows.zip" \
|
||||||
"Windows ZIP"
|
"Windows ZIP"
|
||||||
|
|
||||||
|
# Note: Each copy_artifact returns 0 even if missing, so partial builds succeed
|
||||||
|
|
||||||
# Copy commits data
|
# Copy commits data
|
||||||
if [ -f commits.json ]; then
|
if [ -f commits.json ]; then
|
||||||
echo "✅ Copying commits.json"
|
echo "✅ Copying commits.json"
|
||||||
|
|||||||
Reference in New Issue
Block a user