.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:
Joachim Wiberg
2026-07-30 14:45:11 +02:00
parent 7f37d0c4e9
commit 547e59b2ad
4 changed files with 34 additions and 19 deletions
+5 -6
View File
@@ -1,12 +1,13 @@
name: Bob the Builder
# Run on all branches, including all pull requests, except the 'dev'
# branch since that's where we run Coverity Scan (limited tokens/day)
# Run on push to release branches (master and maintenance N.x), and
# on all pull requests. The 'dev' branch is where we run Coverity
# Scan (limited tokens/day)
on:
push:
branches:
- '**'
- '!dev'
- master
- '[0-9]+.x'
pull_request:
types: [opened, synchronize, reopened, labeled]
@@ -22,8 +23,6 @@ jobs:
# Verify we can build on latest Ubuntu with both gcc and clang
name: ${{ matrix.compiler }}
runs-on: ubuntu-latest
# Skip redundant builds for PRs - prefer PR builds over push builds
if: github.event_name != 'push' || github.ref == 'refs/heads/master'
strategy:
matrix:
compiler: [gcc, clang]
+1 -1
View File
@@ -4,7 +4,7 @@ on:
push:
branches:
- master
- 4.x
- '[0-9]+.x'
paths:
- 'doc/**'
- 'README.md'
+7 -2
View File
@@ -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
+21 -10
View File
@@ -14,22 +14,31 @@ jobs:
schedule:
runs-on: ubuntu-latest
outputs:
run: ${{ steps.schedule.outputs.run }}
branches: ${{ steps.schedule.outputs.branches }}
steps:
- uses: actions/checkout@v4
- name: Check for any commits since last week
with:
fetch-depth: 0
- name: Check for branches with no commits since last week
id: schedule
run: |
commits="$(git log --format=%H --since='1 week ago')"
if [ -z "$commits" ]; then
echo "run=true" >> $GITHUB_OUTPUT
else
echo "run=false" >> $GITHUB_OUTPUT
fi
branches=
maint=$(git branch -r --format='%(refname:lstrip=3)' | grep -E '^[0-9]+\.x$')
for branch in master $maint; do
commits="$(git log --format=%H --since='1 week ago' origin/$branch)"
if [ -z "$commits" ]; then
branches="$branches\"$branch\","
fi
done
echo "branches=[${branches%,}]" >> $GITHUB_OUTPUT
distcheck:
needs: schedule
if: ${{ needs.schedule.outputs.run == 'true' }}
if: ${{ needs.schedule.outputs.branches != '[]' }}
runs-on: ubuntu-latest
strategy:
matrix:
branch: ${{ fromJSON(needs.schedule.outputs.branches) }}
fail-fast: false
steps:
- name: Install dependencies
run: |
@@ -43,6 +52,8 @@ jobs:
(cd libite-2.6.2 && ./configure && make -j9 && sudo make install-strip)
sudo ldconfig
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Base run
run: |
./autogen.sh
@@ -63,5 +74,5 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: finit-weekly-test-logs
name: finit-weekly-test-logs-${{ matrix.branch }}
path: finit-*/_build/sub/test/*.log