Files
factorio/scripts/chart-version.sh
T
feedc0de bf806c886c
Validate, publish and promote Factorio chart / chart (push) Failing after 10s
Publish Factorio deployment as a Helm chart
2026-10-27 07:16:05 +01:00

20 lines
606 B
Bash
Executable File

#!/bin/sh
set -eu
description=$(git describe --tags --long --match 'v[0-9]*' --dirty)
case "$description" in
*-dirty) echo 'Refusing to package a dirty tree' >&2; exit 1 ;;
esac
version=${description#v}
base=${version%%-[0-9]*}
app_version=$(sed -n 's/^appVersion:[[:space:]]*//p' Chart.yaml | tr -d '"')
test -n "$app_version" || { echo 'Chart.yaml appVersion is missing' >&2; exit 1; }
test "$base" = "$app_version" || {
echo "Git release $base does not match Chart.yaml appVersion $app_version" >&2
exit 1
}
case "$version" in
*-0-g*) version=${version%%-0-g*} ;;
esac
printf '%s\n' "$version"