Skip to content

Commit c8ae676

Browse files
committed
Have a single source for flutter version
1 parent 23965e8 commit c8ae676

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

.github/workflows/build-builder-image.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- 'Dockerfile.builder'
99
- '.github/workflows/build-builder-image.yml'
10+
- 'pubspec.yaml'
1011
workflow_dispatch:
1112

1213
env:
@@ -27,6 +28,13 @@ jobs:
2728
- name: Checkout repository
2829
uses: actions/checkout@v4
2930

31+
- name: Extract Flutter version from pubspec.yaml
32+
id: flutter
33+
run: |
34+
FLUTTER_VERSION=$(grep -E '^\s+flutter:\s+' pubspec.yaml | head -1 | sed 's/.*flutter:\s*//')
35+
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_OUTPUT
36+
echo "Using Flutter version: ${FLUTTER_VERSION}"
37+
3038
- name: Set up Docker Buildx
3139
uses: docker/setup-buildx-action@v3
3240

@@ -56,6 +64,8 @@ jobs:
5664
push: true
5765
tags: ${{ steps.meta.outputs.tags }}
5866
labels: ${{ steps.meta.outputs.labels }}
67+
build-args: |
68+
FLUTTER_VERSION=${{ steps.flutter.outputs.FLUTTER_VERSION }}
5969
cache-from: type=gha
6070
cache-to: type=gha,mode=max
6171

.github/workflows/release.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,27 @@ jobs:
1616
outputs:
1717
version: ${{ steps.version.outputs.VERSION }}
1818
tag: ${{ steps.version.outputs.TAG }}
19+
flutter_version: ${{ steps.flutter.outputs.FLUTTER_VERSION }}
1920
steps:
2021
- name: Extract version from tag
2122
id: version
2223
run: |
2324
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2425
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
2526
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
sparse-checkout: pubspec.yaml
31+
sparse-checkout-cone-mode: false
32+
33+
- name: Extract Flutter version from pubspec.yaml
34+
id: flutter
35+
run: |
36+
FLUTTER_VERSION=$(grep -E '^\s+flutter:\s+' pubspec.yaml | head -1 | sed 's/.*flutter:\s*//')
37+
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_OUTPUT
38+
echo "Using Flutter version: ${FLUTTER_VERSION}"
39+
2640
build-android:
2741
name: Android
2842
runs-on: ubuntu-latest
@@ -129,7 +143,7 @@ jobs:
129143
uses: subosito/flutter-action@v2
130144
with:
131145
channel: stable
132-
flutter-version: 3.41.0
146+
flutter-version: ${{ needs.version.outputs.flutter_version }}
133147

134148
- name: Install dependencies
135149
run: flutter pub get
@@ -171,7 +185,7 @@ jobs:
171185
uses: subosito/flutter-action@v2
172186
with:
173187
channel: stable
174-
flutter-version: 3.41.0
188+
flutter-version: ${{ needs.version.outputs.flutter_version }}
175189

176190
- name: Install CocoaPods
177191
run: brew install cocoapods

Dockerfile.builder

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Using Debian Bullseye for maximum AppImage compatibility (GLIBC 2.31)
22
FROM debian:bullseye-20251117@sha256:ee239c601913c0d3962208299eef70dcffcb7aac1787f7a02f6d3e2b518755e6
33

4-
ARG TARGETARCH
4+
ARG FLUTTER_VERSION
55

6-
ARG FLUTTER_VERSION=3.41.0
76
ARG RUST_VERSION=1.83.0
87
ARG ANDROID_CMDLINE_TOOLS_VERSION=11076708
98
ARG ANDROID_BUILD_TOOLS_VERSION=36.0.0
@@ -40,7 +39,6 @@ RUN apt-get update && \
4039
apt-get clean && \
4140
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/*
4241

43-
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-${TARGETARCH}
4442
ENV ANDROID_HOME=/opt/android-sdk
4543
ENV ANDROID_SDK_ROOT=/opt/android-sdk
4644
ENV CARGO_HOME=/opt/cargo

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,4 +1142,4 @@ packages:
11421142
version: "3.1.3"
11431143
sdks:
11441144
dart: "3.11.0"
1145-
flutter: ">=3.35.0"
1145+
flutter: "3.41.0"

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ version: 1.0.8+14
2020

2121
environment:
2222
sdk: 3.11.0
23+
flutter: 3.41.0
2324

2425
flutter_launcher_icons:
2526
android: true

0 commit comments

Comments
 (0)