Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,35 @@ jobs:
WLED_RELEASE: True
WLED_NIGHTLY_BUILD: ${{ inputs.nightly_build && 'true' || 'false' }}
run: pio run -e ${{ matrix.environment }}
- name: Rename Bin
run: mv -v .pio/build/${{ matrix.environment }}/firmware.bin firmware-${{ matrix.environment }}.bin
- name: Collect firmware files
run: |
mkdir -p artifact-${{ matrix.environment }}
cp .pio/build/${{ matrix.environment }}/firmware.bin artifact-${{ matrix.environment }}/firmware.bin
# partitions.bin is only produced by ESP32 builds (not ESP8266)
if [ -f .pio/build/${{ matrix.environment }}/partitions.bin ]; then
cp .pio/build/${{ matrix.environment }}/partitions.bin artifact-${{ matrix.environment }}/partitions.bin
fi
# bootloader.bin is only produced by ESP32 builds using arduino-esp32 >= 2.x (not ESP8266, not old 1.0.x)
if [ -f .pio/build/${{ matrix.environment }}/bootloader.bin ]; then
cp .pio/build/${{ matrix.environment }}/bootloader.bin artifact-${{ matrix.environment }}/bootloader.bin
fi
# boot_app0.bin is copied to the build dir by output_bins.py using the PlatformIO platform API (ESP32 only)
if [ -f .pio/build/${{ matrix.environment }}/boot_app0.bin ]; then
cp .pio/build/${{ matrix.environment }}/boot_app0.bin artifact-${{ matrix.environment }}/boot_app0.bin
fi
echo "--- Collected files for ${{ matrix.environment }} ---"
ls -la artifact-${{ matrix.environment }}/
# Create a zip with all collected files for use as a release asset
(cd artifact-${{ matrix.environment }} && zip ../firmware-${{ matrix.environment }}.zip *)
- uses: actions/upload-artifact@v4
with:
name: firmware-${{ matrix.environment }}
path: firmware-${{ matrix.environment }}.bin
path: artifact-${{ matrix.environment }}/
- uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || inputs.nightly_build
with:
name: firmware-release-${{ matrix.environment }}
path: build_output/release/*.bin
path: |
build_output/release/*.bin
firmware-${{ matrix.environment }}.zip

2 changes: 2 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: firmware-release-*
merge-multiple: true
- name: Show Files
run: ls -la
Expand All @@ -44,6 +45,7 @@ jobs:
files: |
*.bin
*.bin.gz
*.zip
# - name: Repository Dispatch
# uses: peter-evans/repository-dispatch@v3
# with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
pattern: firmware-release-*
merge-multiple: true
- name: "✏️ Generate release changelog"
id: changelog
Expand All @@ -35,4 +36,5 @@ jobs:
files: |
*.bin
*.bin.gz
*.zip

15 changes: 15 additions & 0 deletions pio-scripts/output_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,21 @@ def bin_rename_copy(source, target, env):
if os.path.isfile(source_map):
print(f"Found linker mapfile {source_map}")
shutil.copy(source_map, map_file)

# Copy boot_app0.bin to the build dir if available.
# Use the PlatformIO platform API to locate the exact arduino-esp32 framework package used
# for this build. ESP8266 builds return None from get_package_dir() and are silently skipped.
# Old arduino-esp32 1.0.x builds lack the file under tools/partitions/ and are also skipped.
_ARDUINO_ESP32_PACKAGE = "framework-arduinoespressif32"
try:
framework_dir = env.PioPlatform().get_package_dir(_ARDUINO_ESP32_PACKAGE)
if framework_dir:
boot_app0_src = os.path.join(str(framework_dir), "tools", "partitions", "boot_app0.bin")
if os.path.isfile(boot_app0_src):
shutil.copy(boot_app0_src, os.path.join(builddir, "boot_app0.bin"))
except Exception as e:
print(f"Warning: could not copy boot_app0.bin ({e})")

# Check if this is a release build (CI sets WLED_RELEASE=True)
is_release_build = os.environ.get('WLED_RELEASE', '').lower() in ('true', '1', 'yes')
# show build flags summary for github CI builds
Expand Down
Loading