Skip to content

Fix #34: Release binaries for subcomponents (b0, mcuboot, fwloader) contain versions from previously released build#35

Merged
TheSomeMan merged 3 commits intomasterfrom
issue-34
Feb 16, 2026
Merged

Fix #34: Release binaries for subcomponents (b0, mcuboot, fwloader) contain versions from previously released build#35
TheSomeMan merged 3 commits intomasterfrom
issue-34

Conversation

@TheSomeMan
Copy link
Collaborator

No description provided.

…ontain versions from previously released build
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #34 where release binaries for subcomponents (b0, mcuboot, fwloader) were containing versions from previously released builds. The fix introduces a new --tag_on_master parameter that allows the build system to detect when a subcomponent-specific tag is being built (e.g., b0_v1.0.0) and only package that specific subcomponent's artifacts instead of all components.

Changes:

  • Added --tag_on_master parameter to build.sh to pass tag information from GitHub workflows
  • Modified download logic to skip downloading releases when building a subcomponent release (since they'll be built locally)
  • Added conditional cleanup logic to remove non-target subcomponent binaries and merged files after building
  • Updated all GitHub workflow files to detect tag type and conditionally package only relevant artifacts

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 26 comments.

Show a summary per file
File Description
build.sh Added tag detection logic, modified download behavior for subcomponent releases, added file cleanup for non-target components
.github/workflows/build-fw_ruuviair_a3-prod.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type
.github/workflows/build-fw_ruuviair_a3-dev.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type
.github/workflows/build-fw_ruuviair_a2-prod.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type
.github/workflows/build-fw_ruuviair_a2-dev.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type
.github/workflows/build-fw_ruuviair_a1-dev.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type
.github/workflows/build-fw_nrf52840dk_a2_release_mock.yml Added BUILD_FLAGS with tag info, conditional artifact paths based on subcomponent type, added debug output

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Ensures correct quoting of the BUILD_FLAGS variable when invoking the build script in GitHub Actions workflows.
This prevents potential issues with argument parsing and ensures that the build flags are correctly interpreted.
Also adds an exit in case of unknown subcomponent release tag.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Updates GitHub workflow files to correctly handle cases where the `BUILD_FLAGS` environment variable is empty. This prevents potential errors in the build scripts when no build flags are specified.

The build script also now prints the argument which caused an error.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

@TheSomeMan TheSomeMan requested a review from ojousima February 16, 2026 16:15
Copy link
Member

@ojousima ojousima left a comment

Choose a reason for hiding this comment

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

Thanks, good to merge. I left a nitpick comment on checking master tags, your call if it needs action.

To verify that I have understood correctly:

  • Subcomponent releases are tracked at main repository level
  • This is because artifacts are signed with main project level key
    • Releasing artifacts at subcompont level would not make sense due to keys being associated with the main project(s)
  • Released artifacts are used for reproducibility, we don't want to rebuild bootloader for each new release but rather use the tested and verified binary

@TheSomeMan
Copy link
Collaborator Author

* Subcomponent releases are tracked at main repository level

That's right. "BUILD_VERSIONS" file is used to specify which subcomponent version must be included into combined merged.hex

* This is because artifacts are signed with main project level key
  * Releasing artifacts at subcompont level would not make sense due to keys being associated with the main project(s)

It does not relate to signing. Just all components are build from the main project level (that's how projects are organized in NCS). It's impossible to build subcomponents independently.

* Released artifacts are used for reproducibility, we don't want to rebuild bootloader for  each new release but rather use the tested and verified binary

Initial B0 bootloader was build in ruuvi.air.c repo and it's not possible to rebuild the same binary version from sources in current repo. So, I just included original binary image as part of source code into "ruuvi.air.main/b0_release/v1.0.6" and if "BUILD_VERSIONS" contain line b0=v1.0.6, then original b0 bootloader from "ruuvi.air.main/b0_release/v1.0.6" in merged into "merged.hex" instead of the b0 bootloader which is built by default on the current commit.

For the mcuboot and fwloader "BUILD_VERSIONS" allows to specify which pre-built version to include to meged.hex. The pre-build version is downloaded from GitHub releases (which are automatically created when a tag is assigned).

@TheSomeMan TheSomeMan merged commit ec7308e into master Feb 16, 2026
18 checks passed
@TheSomeMan TheSomeMan deleted the issue-34 branch February 16, 2026 17:20
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.

3 participants