Compiling C firmware: how to insert version number into header file BEFORE building the firmware? #2860
Replies: 2 comments 2 replies
-
Can you build the firmware as part of semantic release using |
Beta Was this translation helpful? Give feedback.
-
This is the main reason I made the plugin I mentioned in another discussion. Since the version tag is determined by commits. Is that something that could be done via a separate CLI command which would just invoke the commit analyzer and spit out the next tag? |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use semantic-release with a C firmware project.
I'd like to show the current version on the device, which is fetched from a header file with a
#define
.In
.releaserc.json
, I have:version_date.sh
echoes the right values into the header file.My problem is that I have to build the firmware first, and then semantic-release runs. As such, the version header file is only updated after the firmware has been built and the version in the compiled artifact is wrong.
How could I solve it? I'm using GitHub Actions (especially to build the firmware), and the workflows are here: https://github.com/coaxial/qmk_keymap/tree/e4c950afa212b19ce3841f1c1666e23388a60a62/.github/workflows. I don't think there is a way to run another GitHub Action as part
@semantic-release/exec
'sprepareCmd
?Beta Was this translation helpful? Give feedback.
All reactions