Skip to content

Commit

Permalink
Update flutter-actions.yml
Browse files Browse the repository at this point in the history
add caching and rm podfile.lock
  • Loading branch information
X-Wei authored Apr 21, 2024
1 parent ab225d6 commit 9668028
Showing 1 changed file with 48 additions and 5 deletions.
53 changes: 48 additions & 5 deletions .github/workflows/flutter-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,76 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Cache Flutter
uses: actions/cache@v2
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
path: ~/.flutter

- name: Cache Gradle
uses: actions/cache@v2
id: gradle-cache
with:
key: $GITHUB_SHA-gradle
path: ~/.gradle

- name: Set up JDK 19
uses: actions/setup-java@v4
with:
java-version: '19'
distribution: 'temurin'
cache: 'gradle'
java-version: "19"
cache: "gradle"

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- run: flutter pub get

- run: flutter build apk

build-ios:
runs-on: macos-latest
steps:
- name: Clone repository
uses: actions/checkout@v4

- name: Cache CocoaPods
uses: actions/cache@v2
id: cocoa-pods-cache
with:
key: $GITHUB_SHA-cocoa-pods
path: ~/Library/Caches/CocoaPods

- name: Cache Xcode Derived Data
uses: actions/cache@v2
id: xcode-derived-data-cache
with:
key: $GITHUB_SHA-xcode-derived-data
path: ~/Library/Developer/Xcode/DerivedData

- name: Cache Flutter
uses: actions/cache@v2
id: flutter-cache
with:
key: $GITHUB_SHA-flutter
path: ~/.flutter

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true

- run: flutter pub get

- name: Update Cocoapods repo
run: pod repo update
- run: flutter pub get

- name: Install pods
run: cd ios && pod install --repo-update && cd ..
run: cd ios && rm Podfile.lock && pod install --repo-update && cd ..

- run: flutter build ios --release --no-codesign

0 comments on commit 9668028

Please sign in to comment.