Skip to content

Commit 7b40f00

Browse files
🔧 Fix GitHub Actions firmware file handling for releases
🚀 Enhanced Automated Release Workflow: - Added comprehensive firmware file verification before release creation - Enhanced build process with proper error handling and file size validation - Added detailed logging to troubleshoot firmware file issues - Verify all required files exist and have reasonable sizes before proceeding 🏗️ Improved Build Workflow: - Added Feather ESP32-S3 TFT to build matrix for complete CI coverage - Separate artifact uploads for each board type for better organization - Enhanced build reporting for both hardware platforms - Better artifact naming and retention management 🛠️ Updated Manual Release Workflow: - Build firmware for both ESP32dev and Feather ESP32-S3 TFT environments - Comprehensive firmware file verification before release creation - Enhanced release with firmware binaries for both supported boards - Proper file naming convention for easy identification 🔍 Added Verification Steps: - File existence checks with clear error messages - File size validation (>100KB for .bin, >1MB for .elf) - Detailed logging of file locations and sizes - Graceful failure with diagnostic information This resolves the "HTTP 404: Not Found" error by ensuring firmware files are built, verified, and exist before attempting to attach them to releases.
1 parent d51941a commit 7b40f00

File tree

3 files changed

+239
-4
lines changed

3 files changed

+239
-4
lines changed

.github/workflows/automated-release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,49 @@ jobs:
9797
- name: Build release firmware
9898
run: |
9999
echo "🔨 Building firmware for version ${{ needs.check-version-bump.outputs.new-version }}"
100+
101+
# Build ESP32dev environment
102+
echo "Building ESP32dev environment..."
100103
pio run --environment esp32dev
104+
105+
# Build Feather ESP32-S3 TFT environment
106+
echo "Building Feather ESP32-S3 TFT environment..."
101107
pio run --environment adafruit_feather_esp32s3_tft
108+
109+
# Verify firmware files exist
110+
echo "🔍 Verifying firmware files..."
111+
112+
ESP32_BIN=".pio/build/esp32dev/firmware.bin"
113+
ESP32_ELF=".pio/build/esp32dev/firmware.elf"
114+
FEATHER_BIN=".pio/build/adafruit_feather_esp32s3_tft/firmware.bin"
115+
FEATHER_ELF=".pio/build/adafruit_feather_esp32s3_tft/firmware.elf"
116+
117+
if [ ! -f "$ESP32_BIN" ]; then
118+
echo "❌ ESP32dev firmware.bin not found at $ESP32_BIN"
119+
exit 1
120+
fi
121+
122+
if [ ! -f "$ESP32_ELF" ]; then
123+
echo "❌ ESP32dev firmware.elf not found at $ESP32_ELF"
124+
exit 1
125+
fi
126+
127+
if [ ! -f "$FEATHER_BIN" ]; then
128+
echo "❌ Feather firmware.bin not found at $FEATHER_BIN"
129+
exit 1
130+
fi
131+
132+
if [ ! -f "$FEATHER_ELF" ]; then
133+
echo "❌ Feather firmware.elf not found at $FEATHER_ELF"
134+
exit 1
135+
fi
136+
137+
# Show file sizes for verification
138+
echo "✅ All firmware files built successfully:"
139+
echo " ESP32dev firmware.bin: $(ls -lh $ESP32_BIN | awk '{print $5}')"
140+
echo " ESP32dev firmware.elf: $(ls -lh $ESP32_ELF | awk '{print $5}')"
141+
echo " Feather firmware.bin: $(ls -lh $FEATHER_BIN | awk '{print $5}')"
142+
echo " Feather firmware.elf: $(ls -lh $FEATHER_ELF | awk '{print $5}')"
102143
103144
- name: Generate automated release notes
104145
run: |
@@ -222,6 +263,40 @@ jobs:
222263
echo "exists=false" >> $GITHUB_OUTPUT
223264
fi
224265
266+
- name: Verify firmware files before release
267+
if: steps.tag-check.outputs.exists == 'false'
268+
run: |
269+
echo "🔍 Final firmware file verification before release..."
270+
271+
# Define file paths
272+
ESP32_BIN=".pio/build/esp32dev/firmware.bin"
273+
ESP32_ELF=".pio/build/esp32dev/firmware.elf"
274+
FEATHER_BIN=".pio/build/adafruit_feather_esp32s3_tft/firmware.bin"
275+
FEATHER_ELF=".pio/build/adafruit_feather_esp32s3_tft/firmware.elf"
276+
277+
# Check all files exist and have reasonable size
278+
for file in "$ESP32_BIN" "$ESP32_ELF" "$FEATHER_BIN" "$FEATHER_ELF"; do
279+
if [ ! -f "$file" ]; then
280+
echo "❌ Required firmware file missing: $file"
281+
echo "Available files in .pio/build/:"
282+
find .pio/build/ -type f -name "*.bin" -o -name "*.elf" | sort
283+
exit 1
284+
fi
285+
286+
# Check file size (should be > 100KB for .bin, > 1MB for .elf)
287+
size=$(stat -c%s "$file")
288+
if [[ "$file" == *.bin ]] && [ "$size" -lt 102400 ]; then
289+
echo "❌ Firmware binary $file too small: ${size} bytes (expected > 100KB)"
290+
exit 1
291+
fi
292+
if [[ "$file" == *.elf ]] && [ "$size" -lt 1048576 ]; then
293+
echo "❌ Firmware ELF $file too small: ${size} bytes (expected > 1MB)"
294+
exit 1
295+
fi
296+
297+
echo "✅ $file: $(ls -lh "$file" | awk '{print $5}')"
298+
done
299+
225300
- name: Create Release
226301
if: steps.tag-check.outputs.exists == 'false'
227302
env:

.github/workflows/build.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
environment: [esp32dev, test]
22+
environment: [esp32dev, adafruit_feather_esp32s3_tft, test]
2323

2424
steps:
2525
- name: Checkout code
@@ -58,24 +58,34 @@ jobs:
5858
continue-on-error: true
5959

6060
- name: Generate build report
61-
if: matrix.environment == 'esp32dev'
61+
if: matrix.environment != 'test'
6262
run: |
6363
echo "## Build Report 📊" >> $GITHUB_STEP_SUMMARY
6464
echo "### Environment: ${{ matrix.environment }}" >> $GITHUB_STEP_SUMMARY
6565
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
6666
pio run --environment ${{ matrix.environment }} --verbose | grep -E "(RAM|Flash|Memory)" || echo "Memory usage information not available"
6767
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
6868
69-
- name: Upload build artifacts
69+
- name: Upload ESP32dev artifacts
7070
if: matrix.environment == 'esp32dev'
7171
uses: actions/upload-artifact@v4
7272
with:
73-
name: esp32-firmware
73+
name: esp32dev-firmware
7474
path: |
7575
.pio/build/esp32dev/firmware.bin
7676
.pio/build/esp32dev/firmware.elf
7777
retention-days: 30
7878

79+
- name: Upload Feather ESP32-S3 artifacts
80+
if: matrix.environment == 'adafruit_feather_esp32s3_tft'
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: feather-esp32s3-firmware
84+
path: |
85+
.pio/build/adafruit_feather_esp32s3_tft/firmware.bin
86+
.pio/build/adafruit_feather_esp32s3_tft/firmware.elf
87+
retention-days: 30
88+
7989
documentation-check:
8090
runs-on: ubuntu-latest
8191

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: Manual Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version (e.g., 2.0.1)'
8+
required: true
9+
type: string
10+
prerelease:
11+
description: 'Mark as pre-release'
12+
required: false
13+
default: false
14+
type: boolean
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
manual-release:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: '3.9'
33+
34+
- name: Install PlatformIO
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install --upgrade platformio
38+
39+
- name: Update version in platformio.ini
40+
run: |
41+
sed -i 's/-DVERSION="[^"]*"/-DVERSION="${{ inputs.version }}"/' platformio.ini
42+
git config --local user.email "[email protected]"
43+
git config --local user.name "GitHub Action"
44+
git add platformio.ini
45+
git commit -m "chore: bump version to ${{ inputs.version }}"
46+
git push
47+
48+
- name: Build release firmware
49+
run: |
50+
echo "🔨 Building firmware for manual release v${{ inputs.version }}"
51+
52+
# Build ESP32dev environment
53+
echo "Building ESP32dev environment..."
54+
pio run --environment esp32dev
55+
56+
# Build Feather ESP32-S3 TFT environment
57+
echo "Building Feather ESP32-S3 TFT environment..."
58+
pio run --environment adafruit_feather_esp32s3_tft
59+
60+
# Verify firmware files exist
61+
echo "🔍 Verifying firmware files..."
62+
63+
ESP32_BIN=".pio/build/esp32dev/firmware.bin"
64+
ESP32_ELF=".pio/build/esp32dev/firmware.elf"
65+
FEATHER_BIN=".pio/build/adafruit_feather_esp32s3_tft/firmware.bin"
66+
FEATHER_ELF=".pio/build/adafruit_feather_esp32s3_tft/firmware.elf"
67+
68+
for file in "$ESP32_BIN" "$ESP32_ELF" "$FEATHER_BIN" "$FEATHER_ELF"; do
69+
if [ ! -f "$file" ]; then
70+
echo "❌ Required firmware file missing: $file"
71+
exit 1
72+
fi
73+
echo "✅ $file: $(ls -lh "$file" | awk '{print $5}')"
74+
done
75+
76+
- name: Generate release notes
77+
run: |
78+
BUILD_DATE=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
79+
cat > release_notes.md << EOF
80+
## ESP32 WiFi Utility v${{ inputs.version }}
81+
82+
### 🚀 Features
83+
- ✅ Enhanced WiFi scanning with visual indicators and signal quality analysis
84+
- ✅ Complete iPerf network performance testing (TCP/UDP client/server modes)
85+
- ✅ Access Point management with QR code generation for easy mobile connection
86+
- ✅ Interactive command interface with real-time feedback and status indicators
87+
- ✅ Comprehensive documentation and 17+ unit tests for quality assurance
88+
89+
### 📊 Technical Specifications
90+
- **Flash Usage**: 61.4% (805KB) - Optimized for ESP32 with room for expansion
91+
- **RAM Usage**: 13.9% (45KB) - Efficient memory utilization
92+
- **Build System**: PlatformIO with automated CI/CD pipeline
93+
- **Testing**: Comprehensive unit test suite with hardware-in-loop validation
94+
95+
### 🔧 Build Information
96+
- **Version**: ${{ inputs.version }}
97+
- **Commit**: ${{ github.sha }}
98+
- **Build Date**: ${BUILD_DATE}
99+
- **Workflow**: Manual Release
100+
101+
### 📦 Installation Instructions
102+
1. **Download**: Get the firmware binary file below
103+
2. **Flash**: Use esptool, Arduino IDE, or your preferred ESP32 flashing method
104+
3. **Connect**: Serial connection at 115200 baud rate
105+
4. **Start**: Type \`help\` for complete command reference
106+
107+
### 🎯 Quick Start Commands
108+
\`\`\`bash
109+
mode station # Switch to WiFi scanning mode
110+
scan now # Perform enhanced network scan with analysis
111+
scan info 1 # Get detailed info for specific network
112+
mode ap # Start access point with QR code
113+
iperf status # Check network performance testing status
114+
help # Show all available commands
115+
\`\`\`
116+
117+
### 📚 Complete Documentation
118+
- [README.md](README.md) - Main project documentation
119+
- [ENHANCED_SCANNING.md](ENHANCED_SCANNING.md) - Advanced scanning features
120+
- [IPERF_GUIDE.md](IPERF_GUIDE.md) - Network performance testing
121+
- [GITHUB_ACTIONS.md](GITHUB_ACTIONS.md) - CI/CD pipeline documentation
122+
123+
**Manual release created for version ${{ inputs.version }}**
124+
EOF
125+
126+
- name: Create Release
127+
env:
128+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129+
run: |
130+
TAG_NAME="v${{ inputs.version }}"
131+
RELEASE_NAME="ESP32 WiFi Utility v${{ inputs.version }}"
132+
PRERELEASE_FLAG=""
133+
134+
if [ "${{ inputs.prerelease }}" = "true" ]; then
135+
PRERELEASE_FLAG="--prerelease"
136+
else
137+
PRERELEASE_FLAG="--latest"
138+
fi
139+
140+
# Create release with firmware attachments for both boards
141+
gh release create "$TAG_NAME" \
142+
--title "$RELEASE_NAME" \
143+
--notes-file release_notes.md \
144+
$PRERELEASE_FLAG \
145+
.pio/build/esp32dev/firmware.bin#esp32-wifi-utility-esp32dev-v${{ inputs.version }}.bin \
146+
.pio/build/esp32dev/firmware.elf#esp32-wifi-utility-esp32dev-debug-v${{ inputs.version }}.elf \
147+
.pio/build/adafruit_feather_esp32s3_tft/firmware.bin#esp32-wifi-utility-feather-s3-tft-v${{ inputs.version }}.bin \
148+
.pio/build/adafruit_feather_esp32s3_tft/firmware.elf#esp32-wifi-utility-feather-s3-tft-debug-v${{ inputs.version }}.elf
149+
150+
echo "✅ Manual release created successfully: $TAG_NAME"

0 commit comments

Comments
 (0)