mirror of
https://github.com/Zakkaus/doona.git
synced 2026-12-05 16:02:03 +00:00
Name release assets with upstream SemVer while preserving each package manager's version ordering in its metadata. Add revision 1 to deb and ipk, and apply nfpm's default epoch workaround only to Arch. Update archive consumers and document the mapping.
20 lines
682 B
Bash
Executable File
20 lines
682 B
Bash
Executable File
#!/bin/sh
|
|
# A stable tag has no prerelease; Arch removes the separator before its prerelease number.
|
|
set -eu
|
|
tag=${1:?usage: tools/version.sh vX.Y.Z[-pre.N]}
|
|
case "$tag" in
|
|
v*) ;;
|
|
*) echo "unexpected tag: $tag (want vX.Y.Z or vX.Y.Z-pre.N)" >&2; exit 1 ;;
|
|
esac
|
|
bare=${tag#v}
|
|
printf '%s\n' "$bare" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-(alpha|beta|rc)\.[0-9]+)?$' || {
|
|
echo "unexpected tag: $tag (want vX.Y.Z or vX.Y.Z-pre.N)" >&2
|
|
exit 1
|
|
}
|
|
version=${bare%%-*}
|
|
pre=${bare#"$version"}
|
|
pre=${pre#-}
|
|
printf 'VERSION=%s\nPRERELEASE=%s\nARCH_PRERELEASE=%s\nNPM=%s\nPACKAGE_RELEASE=1\n' \
|
|
"$version" "$pre" "$(printf '%s' "$pre" | tr -d .)" \
|
|
"$version${pre:+-$pre}"
|