Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflow: Add make release workflow #147

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

balaji-srin
Copy link

@balaji-srin balaji-srin commented Jun 7, 2024

When a release is created this new workflow calls the other build
and test workflows and uploads the tested artifacts into github
release.
The existing workflows were modified to make them callable from other
workflows.
Build workflow now uploads the artifacts so that they can be added to
the release. The build workflow uploads the hex, bin and the .config
file. The names of the files will have the sha if built from main and
the tag name if built from a tag.

The release will look like this with the assets (tested on private fork)

image

The workflow run will look similar to this.

image

Fixes: #139

@balaji-srin balaji-srin force-pushed the add_release_workflow branch 7 times, most recently from b733954 to 441b9b3 Compare June 7, 2024 13:34
@balaji-srin balaji-srin force-pushed the add_release_workflow branch from 441b9b3 to 3d08ca7 Compare June 7, 2024 15:28
@coderbyheart
Copy link
Member

Can you add a https://github.com/actions/upload-artifact step so the files get attached to each build?

@coderbyheart
Copy link
Member

Then the release task doesn't have to build them again.

Copy link
Member

@coderbyheart coderbyheart left a comment

Choose a reason for hiding this comment

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

Ah, I understand now. This builds artifacts when a release is manually created.

@coderbyheart
Copy link
Member

It seems that the version string is not compiled into the firmware.

Copy link
Member

@coderbyheart coderbyheart left a comment

Choose a reason for hiding this comment

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

Build should set release firmware version.

@balaji-srin
Copy link
Author

balaji-srin commented Jun 7, 2024

Build should set release firmware version.

Yes I was also thinking about that. The only reason why I did it this way was that that the on_target job (which does the upload of the built binary) runs every night on main. Then the artifact will have the name main in it instead of a Sha and that would lead to non-unique artifacts for runs on main branch. I believe that's acceptable. Will fix

@coderbyheart
Copy link
Member

You can include the current checksum of main.

@coderbyheart
Copy link
Member

Can you also publish the .config file as an artifact?

@gregersrygg
Copy link
Collaborator

Shouldn't the firmware be built with the app version and report it to cloud? This is perhaps a new task since it isn't implemented yet. So it's fine to just add as a task and do it later.

Did a quick check with @simensrostad now, and the schema includes appVersion: https://github.com/nRFCloud/application-protocols/blob/v1/schemas/deviceToCloud/device/device-example.json
Is this what you use @coderbyheart ?

The modem_info library seems to read out this info from a APP_VERSION cmake variable. So in theory I think we could just read out the environment variable from github and define APP_VERSION in our CMakeLists.txt for the app:

if(DEFINED ENV{GITHUB_REF_NAME})
  set(APP_VERSION $ENV{GITHUB_REF_NAME})
endif()

However, the APP_VERSION defined in app context is not visible to the library. Probably because they're in different variable scopes. So it doesn't work.

@coderbyheart
Copy link
Member

Yes, as reported in #104, the appVersion property is not sent.

@balaji-srin balaji-srin force-pushed the add_release_workflow branch 2 times, most recently from c449901 to 6b63aa9 Compare June 10, 2024 13:04
@balaji-srin
Copy link
Author

Build should set release firmware version.

This is now fixed.

@balaji-srin
Copy link
Author

Can you also publish the .config file as an artifact?

This is done. Now it shows up like this in the release

image

@balaji-srin balaji-srin requested a review from coderbyheart June 10, 2024 13:09
When a release is created this new workflow calls the other build
and test workflows and uploads the tested artifacts into github
release.
The existing workflows were modified to make them callable from other
workflows.
Build workflow now uploads the artifacts so that they can be added to
the release. The build workflow uploads the hex, bin and the .config
file. The names of the files will have the sha if built from main and
the tag name if built from a tag.

Signed-off-by: Balaji Srinivasan <[email protected]>
@balaji-srin balaji-srin force-pushed the add_release_workflow branch from 6b63aa9 to 275343d Compare June 10, 2024 13:10
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@coderbyheart
Copy link
Member

The released firmware does not have the release version configured, but this will be handled in a separate PR.

@balaji-srin balaji-srin merged commit 402d76a into hello-nrfcloud:main Jun 10, 2024
5 checks passed
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.

Publish firmware release
3 participants