295abb37ee
Firmware for an autonomous wave-measurement buoy (ATmega2560-based WII5 v2 board). Reads wave motion from a Sparton AHRS-M1/M2 IMU, samples GPS and battery state, and reports back over Iridium SBD satellite telemetry. Originally developed 2012-2024. This is the first public release. Code, documentation, and field-tested operating modes (Capture, Sleep, Position, ManualTest, SelfTest, LowBattery) are licensed under Apache 2.0 — see LICENSE and NOTICE. See README.md for an overview and build instructions, CONTRIBUTING.md for how to contribute, and DEPLOYMENTS.md for the field-deployment log.
43 lines
1.0 KiB
Bash
Executable File
43 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# Copyright (c) 2012-2024 Scott Penrose <scottp@dd.com.au> and WII5 Buoy contributors
|
|
#
|
|
# This file is part of WII5 Buoy firmware.
|
|
# See LICENSE for full terms.
|
|
|
|
|
|
#get highest tag number
|
|
VERSION=`git describe --abbrev=0 --tags`
|
|
SHORT=$(git log -1 --pretty=format:%h)
|
|
|
|
#replace . with space so can split into an array
|
|
VERSION_BITS=(${VERSION//./ })
|
|
|
|
#get number parts and increase last one by 1
|
|
VNUM1=${VERSION_BITS[0]}
|
|
VNUM2=${VERSION_BITS[1]}
|
|
VNUM3=${VERSION_BITS[2]}
|
|
VNUM3=$((VNUM3+1))
|
|
|
|
#create new tag
|
|
NEW_TAG="$VNUM1.$VNUM2.$VNUM3"
|
|
|
|
echo "Updating $VERSION to $NEW_TAG"
|
|
|
|
#get current hash and see if it already has a tag
|
|
GIT_COMMIT=`git rev-parse HEAD`
|
|
NEEDS_TAG=`git describe --contains $GIT_COMMIT 2>/dev/null`
|
|
|
|
#only tag if no tag already
|
|
if [ -z "$NEEDS_TAG" ]; then
|
|
echo "version=$NEW_TAG" > VERSION
|
|
echo "short=$SHORT" >> VERSION
|
|
git add VERSION
|
|
git commit -m 'Auto update version file'
|
|
git tag $NEW_TAG
|
|
echo "Tagged with $NEW_TAG"
|
|
git push --tags
|
|
else
|
|
echo "Already a tag on this commit"
|
|
fi
|