Skip to content

Commit bd3d36c

Browse files
committed
refactor(ci): update documentation build workflow to specifically handle .merged.bin files for improved clarity and accuracy
1 parent 15f3a21 commit bd3d36c

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

.github/workflows/docs_build.yml

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
9696
- name: Copy cached binaries to docs/_static/binaries/
9797
run: |
98-
echo "Copying cached binaries to docs/_static/binaries/"
98+
echo "Copying cached .merged.bin binaries to docs/_static/binaries/"
9999
mkdir -p docs/_static/binaries
100100
101101
if [ ! -d "docs_binaries" ]; then
@@ -104,30 +104,27 @@ jobs:
104104
exit 0
105105
fi
106106
107-
# Find all .bin files in docs_binaries
108-
echo "Processing binary files from macOS builds..."
107+
# Find only .merged.bin files in docs_binaries
108+
echo "Processing .merged.bin files from macOS builds..."
109109
110110
# Binaries are stored in structure like:
111-
# docs_binaries/{target}/{SketchName}/build.tmp/{SketchName}.ino.bin
111+
# docs_binaries/{target}/{SketchName}/build.tmp/{SketchName}.ino.merged.bin
112112
# We need to:
113113
# 1. Extract sketch name and target from path
114114
# 2. Find the sketch in libraries/ directory
115-
# 3. Copy to docs/_static/binaries/libraries/{LibraryName}/examples/{SketchName}/{target}/
115+
# 3. Copy .merged.bin to docs/_static/binaries/libraries/{LibraryName}/examples/{SketchName}/{target}/
116116
117117
bin_count=0
118118
skip_count=0
119119
120120
while IFS= read -r bin_file; do
121121
echo "Processing: $bin_file"
122122
123-
# Extract the binary filename (e.g., WiFiClientSecure.ino.bin)
123+
# Extract the binary filename (e.g., WiFiClientSecure.ino.merged.bin)
124124
bin_name=$(basename "$bin_file")
125125
126-
# Extract sketch name (remove .ino.bin or .bin extension)
127-
sketch_name="${bin_name%.ino.bin}"
128-
if [ "$sketch_name" == "$bin_name" ]; then
129-
sketch_name="${bin_name%.bin}"
130-
fi
126+
# Extract sketch name (remove .ino.merged.bin extension)
127+
sketch_name="${bin_name%.ino.merged.bin}"
131128
132129
# Extract target from path (esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32h2, esp32p4, esp32c5)
133130
if [[ "$bin_file" =~ /(esp32[a-z0-9]*)/ ]]; then
@@ -161,23 +158,23 @@ jobs:
161158
output_dir="docs/_static/binaries/libraries/${relative_path}/${target}"
162159
mkdir -p "$output_dir"
163160
164-
# Copy the binary
161+
# Copy only the .merged.bin file
165162
cp "$bin_file" "$output_dir/"
166163
echo " → Copied to: $output_dir/$bin_name"
167164
bin_count=$((bin_count + 1))
168-
done < <(find docs_binaries -type f -name "*.bin")
165+
done < <(find docs_binaries -type f -name "*.merged.bin")
169166
170167
echo ""
171168
echo "=========================================="
172-
echo "Binary copy completed!"
173-
echo " Binaries copied: $bin_count"
174-
echo " Binaries skipped: $skip_count"
169+
echo ".merged.bin copy completed!"
170+
echo " .merged.bin files copied: $bin_count"
171+
echo " Files skipped: $skip_count"
175172
echo "=========================================="
176173
echo ""
177174
echo "Final structure in docs/_static/binaries/:"
178-
find docs/_static/binaries -type f -name "*.bin" | head -30
175+
find docs/_static/binaries -type f -name "*.merged.bin" 2>/dev/null | head -30 || true
179176
echo ""
180-
echo "Total binaries in docs/_static/binaries/: $(find docs/_static/binaries -type f -name "*.bin" | wc -l)"
177+
echo "Total .merged.bin files in docs/_static/binaries/: $(find docs/_static/binaries -type f -name "*.merged.bin" 2>/dev/null | wc -l)"
181178
182179
- name: Cleanup Binaries
183180
run: |
@@ -190,16 +187,16 @@ jobs:
190187
echo "=========================================="
191188
if [ -d "docs/_static/binaries" ]; then
192189
echo "Directory tree:"
193-
find docs/_static/binaries -type f | sort
190+
find docs/_static/binaries -type f 2>/dev/null | sort || true
194191
echo ""
195192
echo "Files by type:"
196-
echo " .bin files: $(find docs/_static/binaries -type f -name "*.bin" | wc -l)"
197-
echo " .elf files: $(find docs/_static/binaries -type f -name "*.elf" | wc -l)"
198-
echo " .json files: $(find docs/_static/binaries -type f -name "*.json" | wc -l)"
199-
echo " .toml files: $(find docs/_static/binaries -type f -name "*.toml" | wc -l)"
193+
echo " .merged.bin files: $(find docs/_static/binaries -type f -name "*.merged.bin" 2>/dev/null | wc -l)"
194+
echo " .json files: $(find docs/_static/binaries -type f -name "*.json" 2>/dev/null | wc -l)"
195+
echo " .toml files: $(find docs/_static/binaries -type f -name "*.toml" 2>/dev/null | wc -l)"
196+
echo " diagram.json files: $(find docs/_static/binaries -type f -name "diagram*.json" 2>/dev/null | wc -l)"
200197
echo ""
201198
echo "Example of final structure (first 20 files):"
202-
find docs/_static/binaries -type f | head -20
199+
find docs/_static/binaries -type f 2>/dev/null | head -20 || true
203200
else
204201
echo "WARNING: docs/_static/binaries/ directory not found!"
205202
fi

0 commit comments

Comments
 (0)