.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 committed 2026-07-30 14:45:11 +02:00
1 parent 7f37d0c4e9
commit 547e59b2ad
4 files changed
+34 -19

No files matched your search

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