Scrap redundant docker builds on releases (#8999)

Our release workflow is pretty inefficient and slow. This PR aims to consolidate and cut down on duplicate tasks.


  1) We now run the whole build process both on pushing to the `stable` branch and pushing a version tag.
A quick win is to not fire off separate builds.

~~2) The Docker release workflow could re-use the binaries being built instead of doing its own cross-compilation. ~~
we won't take this on _right now_


Co-Authored-By: antondlr <anton@sigmaprime.io>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
antondlr
2026-03-23 07:25:06 +01:00
committed by GitHub
parent 8f9c1ca9ca
commit e21053311d
2 changed files with 20 additions and 10 deletions

View File

@@ -4,7 +4,6 @@ on:
push:
branches:
- unstable
- stable
tags:
- v*
@@ -28,11 +27,6 @@ jobs:
extract-version:
runs-on: ubuntu-22.04
steps:
- name: Extract version (if stable)
if: github.event.ref == 'refs/heads/stable'
run: |
echo "VERSION=latest" >> $GITHUB_ENV
echo "VERSION_SUFFIX=" >> $GITHUB_ENV
- name: Extract version (if unstable)
if: github.event.ref == 'refs/heads/unstable'
run: |
@@ -159,7 +153,16 @@ jobs:
- name: Create and push multiarch manifests
run: |
# Create the main tag (versioned for releases, latest-unstable for unstable)
docker buildx imagetools create -t ${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}${VERSION_SUFFIX} \
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-arm64${VERSION_SUFFIX} \
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-amd64${VERSION_SUFFIX};
# For version tags, also create/update the latest tag to keep stable up to date
# Only create latest tag for proper release versions (e.g. v1.2.3, not v1.2.3-alpha)
if [[ "${GITHUB_REF}" == refs/tags/* ]] && [[ "${VERSION}" =~ ^v[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$ ]]; then
docker buildx imagetools create -t ${{ github.repository_owner}}/${{ matrix.binary }}:latest \
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-arm64${VERSION_SUFFIX} \
${{ github.repository_owner}}/${{ matrix.binary }}:${VERSION}-amd64${VERSION_SUFFIX};
fi