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

Improve release building - add checking for uncommitted changes #67

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/targets/ruuvigw_nrf/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ set -x #echo on
cd "$(dirname "$0")"
NAME="ruuvigw"

VERSION=$(git describe --exact-match --tags HEAD 2>/dev/null)
GIT_DESCRIBE_EXIT_STATUS=$?

if [ $GIT_DESCRIBE_EXIT_STATUS -ne 0 ]; then
# No exact tag, use short commit hash
VERSION=$(git rev-parse --short HEAD)
VERSION=$(git describe --exact-match --tags HEAD 2>/dev/null || git rev-parse --short HEAD)
if [ -n "$(git status --porcelain)" ]; then
VERSION="${VERSION}-dirty"
fi

while getopts "n:v:" option;
Expand All @@ -28,7 +25,7 @@ rm ruuvigw_nrf*${NAME}*
mergehex -m ../../../nRF5_SDK_15.3.0_59ac345/components/softdevice/s140/hex/s140_nrf52_6.1.1_softdevice.hex _build/nrf52811_xxaa.hex -o packet.hex

# Check if the version was obtained from a git tag
if [ $GIT_DESCRIBE_EXIT_STATUS -eq 0 ]; then
if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# Version is from a git tag,
# use generate_uicr_hex.py to generate the UICR HEX file
python3 ../../../scripts/generate_uicr_hex.py "$VERSION" uicr_data.hex
Expand Down
Loading