fix: change version format
LIBRETIME_VERSION is now: - the tag name for a tagged version - the head ref name and commit sha for untagged versions (main branch and pull requests)
This commit is contained in:
parent
09a75570f3
commit
a6f0642f71
|
@ -15,9 +15,9 @@ typeset -r version_file="VERSION"
|
||||||
if [[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" == "true" ]]; then
|
if [[ "$(git rev-parse --is-inside-work-tree 2> /dev/null)" == "true" ]]; then
|
||||||
tag=$(git tag --points-at HEAD | tee "$version_file" || error "could not extract tag")
|
tag=$(git tag --points-at HEAD | tee "$version_file" || error "could not extract tag")
|
||||||
if [[ -z "$tag" ]]; then
|
if [[ -z "$tag" ]]; then
|
||||||
latest_tag=$(git describe --abbrev=0 --tags || error "could not extract latest tag")
|
ref="${GITHUB_REF_NAME:-$(git rev-parse --abbrev-ref HEAD || error "could not extract ref")}"
|
||||||
latest_commit=$(git rev-parse --short HEAD || error "could not extract commit sha")
|
sha="${GITHUB_SHA:-$(git rev-parse HEAD || error "could not extract commit sha")}"
|
||||||
echo "$latest_tag-dev+$latest_commit" > "$version_file"
|
echo "$ref-$sha" > "$version_file"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ ! -f "$version_file" ]]; then
|
if [[ ! -f "$version_file" ]]; then
|
||||||
|
|
Loading…
Reference in New Issue