Fix #34: Release binaries for subcomponents (b0, mcuboot, fwloader) contain versions from previously released build#35
Conversation
…ontain versions from previously released build
There was a problem hiding this comment.
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_masterparameter 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
ojousima
left a comment
There was a problem hiding this comment.
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
That's right. "BUILD_VERSIONS" file is used to specify which subcomponent version must be included into combined merged.hex
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.
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 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). |



No description provided.