Poor man's templating for PRST_ZB_BUILD_DATE=__TODAY__ in GitHub actions

This commit is contained in:
rbaron 2022-12-24 10:19:10 +01:00
parent 3d68e5c689
commit c5a129a39a
2 changed files with 8 additions and 0 deletions

View file

@ -7,8 +7,15 @@ REVISION=$3
CMAKE_EXTRA=$4
OUTPUT_BIN=$5
TODAY=$(date +'%Y-%m-%d')
# Replaces occurrences of "__TODAY__" with $TODAY in $CMAKE_EXTRA.
CMAKE_EXTRA="${CMAKE_EXTRA/__TODAY__/"$TODAY"}"
cd "${GITHUB_WORKSPACE}/${SAMPLE_DIR}"
echo $CMAKE_EXTRA
west build --build-dir ./build --pristine --board "${BOARD}@${REVISION}" -- $CMAKE_EXTRA
mv build/zephyr/zephyr.hex build/zephyr/"${OUTPUT_BIN}"

View file

@ -79,3 +79,4 @@ jobs:
sample-dir: code/nrf-connect/samples/zigbee
board: bparasite_nrf52840
output-bin: zigbee_nrf52840_default.hex
cmake-extra: -DPRST_ZB_BUILD_DATE=__TODAY__