Use latest Flutter stable for pre-release builds
Some checks failed
Build and Push Flutter SDK Image / build-and-push (Flutter SDK for Android CI builds, Dockerfile.android, gpb-flutter-sdk-android) (release) Failing after 7s
Build and Push Flutter SDK Image / build-and-push (Minimal Flutter SDK for Web/WASM CI builds, Dockerfile, gpb-flutter-sdk-web) (release) Failing after 7s
Build and Push Flutter SDK Image / build-and-push (Flutter SDK for Linux desktop CI builds, Dockerfile.linux, gpb-flutter-sdk-linux) (release) Failing after 8s

Pre-release triggers now fetch the current Flutter stable version
from the releases API instead of using the release tag. This allows
testing the pipeline with any pre-release tag name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mathias Beaulieu-Duncan 2026-02-02 00:59:50 -05:00
parent 34c649cbda
commit 9c4100dce5

View File

@ -26,12 +26,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Determine Tag Type
id: tag_type
- name: Determine version and tag type
id: version
run: |
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
# Pre-release: fetch latest stable version, tag as dev
FLUTTER_VERSION=$(curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json \
| jq -r '.current_release.stable as $hash | .releases[] | select(.hash == $hash and .channel == "stable") | .version')
echo "flutter_version=${FLUTTER_VERSION}" >> $GITHUB_OUTPUT
echo "tag=dev" >> $GITHUB_OUTPUT
echo "Using latest Flutter stable ${FLUTTER_VERSION} for pre-release test"
else
# Full release: use the release tag as the Flutter version
echo "flutter_version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
echo "tag=latest" >> $GITHUB_OUTPUT
fi
@ -53,8 +60,8 @@ jobs:
push: false
load: true
build-args: |
FLUTTER_VERSION=${{ github.event.release.tag_name }}
tags: ${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ github.event.release.tag_name }}
FLUTTER_VERSION=${{ steps.version.outputs.flutter_version }}
tags: ${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ steps.version.outputs.flutter_version }}
- name: Install Docker Scout
run: |
@ -63,7 +70,7 @@ jobs:
- name: Docker Scout CVE Scan
run: |
docker scout cves ${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ github.event.release.tag_name }} --only-severity critical,high
docker scout cves ${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ steps.version.outputs.flutter_version }} --only-severity critical,high
- name: Build and push with attestations
uses: docker/build-push-action@v5
@ -75,12 +82,12 @@ jobs:
sbom: true
provenance: mode=max
build-args: |
FLUTTER_VERSION=${{ github.event.release.tag_name }}
FLUTTER_VERSION=${{ steps.version.outputs.flutter_version }}
tags: |
${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ github.event.release.tag_name }}
${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ steps.tag_type.outputs.tag }}
${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ steps.version.outputs.flutter_version }}
${{ vars.REGISTRY }}/${{ matrix.image_name }}:${{ steps.version.outputs.tag }}
labels: |
org.opencontainers.image.title=${{ matrix.image_name }}
org.opencontainers.image.description=${{ matrix.description }}
org.opencontainers.image.version=${{ github.event.release.tag_name }}
org.opencontainers.image.version=${{ steps.version.outputs.flutter_version }}
org.opencontainers.image.revision=${{ github.sha }}