Skip to content

Commit

Permalink
CI: use flutter-version-file argument to subosito/flutter-action (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmendes authored Apr 1, 2024
2 parents 5a4805c + 772bbbe commit 5ec899f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 34 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
git fetch origin develop
git pull origin master
echo "DEVELOP_HASH=$(git rev-parse origin/develop)" >> $GITHUB_ENV
echo "MASTER_HASH=$(git rev-parse origin/master^2)" >> $GITHUB_ENV
echo "MASTER_HASH=$(git rev-parse origin/master^2)" >> $GITHUB_ENV
- name: Get latest version (develop)
if: github.ref != 'refs/heads/master'
Expand All @@ -48,15 +48,15 @@ jobs:
google_service_account_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
package_name: ${{ secrets.ANDROID_PACKAGE_NAME }}
track: "beta"

- name: Get latest production version
uses: LuisDuarte1/[email protected]
id: latest-production-version
with:
google_service_account_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_JSON }}
package_name: ${{ secrets.ANDROID_PACKAGE_NAME }}
track: "production"

- name: Bump beta version
uses: LuisDuarte1/[email protected]
if: github.ref != 'refs/heads/master'
Expand All @@ -66,7 +66,7 @@ jobs:
production_version: ${{ steps.latest-production-version.outputs.latest_version_name }}
staging_version: ${{ steps.latest-beta-version.outputs.latest_version_name }}
bump_type: prerelease

- name: Bump prod version (from develop)
uses: LuisDuarte1/[email protected]
if: github.ref == 'refs/heads/master' && env.MASTER_HASH == env.DEVELOP_HASH
Expand All @@ -84,7 +84,7 @@ jobs:
current_environment: production
production_version: ${{ steps.latest-production-version.outputs.latest_version_name }}
bump_type: patch

- name: Combine output and write new version into file
run: |
export NEW_VERSION_NAME=${{
Expand All @@ -106,17 +106,11 @@ jobs:
java-version: ${{env.JAVA_VERSION}}
distribution: "zulu"

- uses: mikefarah/yq@master
name: Get Flutter version
id: get_flutter_version
with:
cmd: yq '.environment.flutter' uni/pubspec.yaml

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ steps.get_flutter_version.outputs.result }}
flutter-version-file: uni/pubspec.yaml
cache: true

- name: Download Android keystore
Expand All @@ -133,7 +127,7 @@ jobs:
- name: Create .env file
run: echo "${{vars.UNI_ENV_FILE}}" > ./assets/env/.env

- name: Build Android App Bundle
run: |
flutter pub get
Expand Down
24 changes: 3 additions & 21 deletions .github/workflows/format_lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ jobs:
- name: Clone repository
uses: actions/checkout@v4

- uses: mikefarah/yq@master
name: Get Flutter version
id: get_flutter_version
with:
cmd: yq '.environment.flutter' uni/pubspec.yaml

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ steps.get_flutter_version.outputs.result }}
flutter-version-file: uni/pubspec.yaml
cache: true

- run: dart format $(find . -type f -name "*.dart" -a -not -name "*.g.dart" -a -not -name "*.mocks.dart") --set-exit-if-changed
Expand All @@ -48,17 +42,11 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
distribution: zulu

- uses: mikefarah/yq@master
name: Get Flutter version
id: get_flutter_version
with:
cmd: yq '.environment.flutter' uni/pubspec.yaml

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ steps.get_flutter_version.outputs.result }}
flutter-version-file: uni/pubspec.yaml
cache: true

- run: flutter analyze .
Expand All @@ -77,17 +65,11 @@ jobs:
java-version: ${{ env.JAVA_VERSION }}
distribution: zulu

- uses: mikefarah/yq@master
name: Get Flutter version
id: get_flutter_version
with:
cmd: yq '.environment.flutter' uni/pubspec.yaml

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ steps.get_flutter_version.outputs.result }}
flutter-version-file: uni/pubspec.yaml
cache: true

- name: Test with coverage
Expand Down

0 comments on commit 5ec899f

Please sign in to comment.