Skip to content

Commit

Permalink
refactor: Fetch FLUTTER_VERSION from pubspec.yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Dec 30, 2024
1 parent b62d3b4 commit c1bd537
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 16 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- run: flutter pub get
- run: flutter gen-l10n
Expand All @@ -35,11 +35,11 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-version: 17
distribution: "zulu"
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- run: flutter pub get
- run: flutter build apk --debug
Expand All @@ -51,7 +51,7 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- run: flutter pub get
- name: Prepare web
Expand All @@ -68,6 +68,8 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install git wget curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y
- uses: chrisdickinson/setup-yq@latest
- run: FLUTTER_VERSION=$(yq e '.environment.flutter' pubspec.yaml)
- name: Install Flutter
run: |
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
Expand All @@ -82,7 +84,7 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- name: Setup Xcode version
uses: maxim-lobanov/[email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
- name: Remove Emoji Font
run: |
rm -rf fonts/NotoEmoji
Expand All @@ -44,11 +44,11 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-version: 17
distribution: 'zulu'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install nodejs -y
Expand Down Expand Up @@ -73,11 +73,11 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-version: 17
distribution: 'zulu'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- name: Apply Google Services Patch
run: git apply ./scripts/enable-android-google-services.patch
Expand Down Expand Up @@ -110,9 +110,10 @@ jobs:
runs-on: ${{ matrix.arch == 'arm64' && 'self-hosted' || 'ubuntu-latest'}}
steps:
- uses: actions/checkout@v4
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y
- uses: chrisdickinson/setup-yq@latest
- run: FLUTTER_VERSION=$(yq e '.environment.flutter' pubspec.yaml)
- name: Install Flutter
run: |
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
Expand All @@ -138,11 +139,11 @@ jobs:
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
java-version: 17
distribution: 'zulu'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
flutter-version-file: pubspec.yaml
cache: true
- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/versions.env

This file was deleted.

1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version: 1.23.0+3536

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: 3.27.1

dependencies:
animations: ^2.0.11
Expand Down

0 comments on commit c1bd537

Please sign in to comment.