From 9668028ddaa6cfdbf97136bfb62a4b963e797a3d Mon Sep 17 00:00:00 2001 From: xwei Date: Sun, 21 Apr 2024 16:50:51 +0200 Subject: [PATCH] Update flutter-actions.yml add caching and rm podfile.lock --- .github/workflows/flutter-actions.yml | 53 ++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/.github/workflows/flutter-actions.yml b/.github/workflows/flutter-actions.yml index 33059fc..8f8f258 100644 --- a/.github/workflows/flutter-actions.yml +++ b/.github/workflows/flutter-actions.yml @@ -9,18 +9,35 @@ 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: @@ -28,14 +45,40 @@ jobs: 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