Skip to content

Name CI artifacts by WLED_RELEASE_NAME instead of PlatformIO env#5545

Open
netmindz wants to merge 2 commits intowled:mainfrom
netmindz:pr-asset-naming
Open

Name CI artifacts by WLED_RELEASE_NAME instead of PlatformIO env#5545
netmindz wants to merge 2 commits intowled:mainfrom
netmindz:pr-asset-naming

Conversation

@netmindz
Copy link
Copy Markdown
Member

@netmindz netmindz commented Apr 26, 2026

PR build artifact zips are now named firmware-<RELEASE_NAME> (e.g. firmware-ESP32.zip) rather than firmware-<pio_env> (e.g. firmware-esp32dev.zip), making it easier for users to identify the correct build when testing PRs, so they don't have to handle two different naming conventions between release and PR

Summary by CodeRabbit

  • Chores
    • Build artifact naming now derives the release name from the first produced firmware binary, replacing the previous fixed scheme.
    • If no firmware binary is found, the pipeline falls back to an environment-based default name.
    • The artifact upload step now uses the computed name so released artifacts reflect actual outputs.

PR build artifact zips are now named firmware-<RELEASE_NAME> (e.g.
firmware-ESP32.zip) rather than firmware-<pio_env> (e.g.
firmware-esp32dev.zip), making it easier for users to identify the
correct build when testing PRs.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7a54d84b-a937-4951-82c1-61fda628f8bc

📥 Commits

Reviewing files that changed from the base of the PR and between 7a71efe and 18a9986.

📒 Files selected for processing (1)
  • .github/workflows/build.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build.yml

Walkthrough

The GitHub Actions build workflow adds a step that inspects build_output/release/*.bin, derives an artifact name from the first .bin by stripping the leading WLED_<version>_ prefix, sets it to GITHUB_OUTPUT, falls back to firmware-${{ matrix.environment }} if none found, and uses that value for the upload name.

Changes

Cohort / File(s) Summary
Workflow Artifact Naming
​.github/workflows/build.yml
Added a step to compute an artifact name from the first build_output/release/*.bin (basename with WLED_<version>_ prefix removed), write it to GITHUB_OUTPUT, provide a fallback firmware-${{ matrix.environment }}, and use that output as the upload artifact name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: renaming CI artifacts from using PlatformIO environment names to WLED_RELEASE_NAME for better consistency and user experience.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/build.yml (1)

69-69: Optional: avoid parsing ls output; use a bash glob instead.

ls build_output/release/*.bin 2>/dev/null | head -1 relies on parsing ls and on the quirk that command substitution swallows the failing exit status (when no files match, bash passes the literal pattern to ls). A nullglob array or find -print -quit is more robust and clearer in intent.

♻️ Proposed refactor
-        bin=$(ls build_output/release/*.bin 2>/dev/null | head -1)
-        if [ -n "$bin" ]; then
+        shopt -s nullglob
+        bins=(build_output/release/*.bin)
+        if [ ${`#bins`[@]} -gt 0 ]; then
+          bin="${bins[0]}"
           # Strip WLED_<version>_ prefix from WLED_<version>_<RELEASE_NAME>.bin
           base=$(basename "$bin" .bin)
           release_name=$(echo "$base" | sed 's/^WLED_[^_]*_//')
           echo "name=firmware-$release_name" >> $GITHUB_OUTPUT
         else
           echo "name=firmware-${{ matrix.environment }}" >> $GITHUB_OUTPUT
         fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/build.yml at line 69, The current command substitution
using "bin=$(ls build_output/release/*.bin 2>/dev/null | head -1)" is fragile;
replace it with a robust shell pattern or find-based approach: enable bash
nullglob and pick the first element of the glob array (e.g., set nullglob and
use the first entry of build_output/release/*.bin) or use find with -print -quit
to produce a single path and assign it to the bin variable. Update the
assignment to use the chosen approach so that the bin variable is empty or unset
when no files exist and avoid parsing ls output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/build.yml:
- Line 69: The current command substitution using "bin=$(ls
build_output/release/*.bin 2>/dev/null | head -1)" is fragile; replace it with a
robust shell pattern or find-based approach: enable bash nullglob and pick the
first element of the glob array (e.g., set nullglob and use the first entry of
build_output/release/*.bin) or use find with -print -quit to produce a single
path and assign it to the bin variable. Update the assignment to use the chosen
approach so that the bin variable is empty or unset when no files exist and
avoid parsing ls output.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b5c39717-c8db-46fa-b41e-c40a4896b5cd

📥 Commits

Reviewing files that changed from the base of the PR and between a535c56 and 7a71efe.

📒 Files selected for processing (1)
  • .github/workflows/build.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant