mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
.github: allow building and releasing from maintenance branches
With 5.0 on master, maintenance releases move to a 4.x branch: run push builds, docs deploy, and weekly distcheck for any N.x branch, and mark only the highest stable tag as the latest release. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+34
-19
No files matched your search
@@ -31,12 +31,17 @@ jobs:
|
||||
run: |
|
||||
ver=${GITHUB_REF#refs/tags/}
|
||||
echo "ver=${ver}" >> $GITHUB_OUTPUT
|
||||
if echo $ver | grep -qE '^[0-9]+\.[0-9]+(\.[0-9]+)?(-alpha|-beta|-rc)[0-9]*$'; then
|
||||
stable='[0-9]+\.[0-9]+(\.[0-9]+)?'
|
||||
if echo $ver | grep -qE "^${stable}(-alpha|-beta|-rc)[0-9]*$"; then
|
||||
echo "pre=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "pre=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
if echo $ver | grep -qE '^[0-9.]+\.[0-9.]+(\.[0-9]+)?$'; then
|
||||
# Mark as latest release only if this is the highest stable
|
||||
# tag, so a 4.x maintenance release doesn't outrank 5.x
|
||||
newest=$(git ls-remote --tags --refs origin | awk -F/ '{print $NF}' \
|
||||
| grep -E "^${stable}$" | sort -V | tail -1)
|
||||
if [ "$ver" = "$newest" ]; then
|
||||
echo "latest=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "latest=false" >> $GITHUB_OUTPUT
|
||||
|
||||
Reference in new issue
Block a user