[misc] Build release branches in the Release workflow

Pushes to release-* branches now run the Release workflow and publish
immutable sha-* container images, the way pushes to main already do.
Without this, a release branch had no post-merge CI and no artifact to
run the pre-release test suites against before tagging.

The floating "main" image tag is only pushed for main builds; release
branches get the sha-* tag alone.
This commit is contained in:
Brad Ison
2026-08-11 18:18:10 +02:00
parent 052cf5a748
commit c30294f311

View File

@@ -6,6 +6,7 @@ on:
- "v*"
branches:
- main
- "release-*"
pull_request:
env:
@@ -254,15 +255,19 @@ jobs:
id: tag_and_push_images
if: |
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
(github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-')))
run: |
set -euo pipefail
resolve_tags() {
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "pr-${{ github.event.pull_request.number }}"
else
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "main sha-$(git rev-parse --short HEAD)"
else
# Release branches get an immutable sha-* tag only — the floating
# "main" tag must never move from a release branch.
echo "sha-$(git rev-parse --short HEAD)"
fi
}