mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07: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:
@@ -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]
|
||||
|
||||
@@ -4,7 +4,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 4.x
|
||||
- '[0-9]+.x'
|
||||
paths:
|
||||
- 'doc/**'
|
||||
- 'README.md'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user