Skip to content

fix: implement custom transformer to sanitize malformed Content-Type … #286

fix: implement custom transformer to sanitize malformed Content-Type …

fix: implement custom transformer to sanitize malformed Content-Type … #286

Workflow file for this run

name: Warm Caches
on:
push:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
warm-caches-linux:
name: Warm caches (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: Get Java Version
run: echo "JAVA_VERSION=$(java -XshowSettings:properties -version 2>&1 | grep 'java.runtime.version' | awk '{print $3}')" >> $GITHUB_ENV
- name: Setup Flutter (cached)
id: cache_flutter_linux
uses: subosito/flutter-action@v2
with:
flutter-version-file: .flutter-version
channel: 'main'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
cache-path: '${{ runner.tool_cache }}/flutter'
- name: Flutter precache (Linux)
run: |
flutter config --enable-linux-desktop
flutter precache --linux
- name: Cache Pub dependencies
uses: actions/cache@v5
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Get dependencies
run: |
# 如果 pubspec.lock 未变化,actions/cache 会命中,跳过更新
# 但需要执行一次 pub get 以确保缓存目录结构存在
flutter pub get
- name: Cache Gradle
id: cache_gradle_linux
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('pubspec.lock', '**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Warm Android build (Debug)
if: ${{ steps.cache_gradle_linux.outputs.cache-hit != 'true' || steps.cache_flutter_linux.outputs.cache-hit != 'true' }}
run: |
# 通过一次 Debug 构建触发 Gradle 依赖解析与下载,以填充缓存。
# Debug 构建无需签名配置,避免 release 构建的密钥要求。
flutter build apk --debug --target-platform=android-arm64
- name: Cache CMake
id: cache_cmake_linux
uses: actions/cache@v5
with:
path: |
build/linux
~/.cmake
key: ${{ runner.os }}-java-${{ env.JAVA_VERSION }}-cmake-debug-${{ hashFiles('pubspec.lock', '**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-java-${{ env.JAVA_VERSION }}-cmake-debug-
- name: Install Linux dependencies
if: ${{ steps.cache_cmake_linux.outputs.cache-hit != 'true' || steps.cache_flutter_linux.outputs.cache-hit != 'true' }}
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libblkid-dev libsecret-1-dev file libfuse2 lld
- name: Build Linux (Debug)
if: ${{ steps.cache_cmake_linux.outputs.cache-hit != 'true' || steps.cache_flutter_linux.outputs.cache-hit != 'true' }}
run: |
if [ "${{ steps.cache_cmake_linux.outputs.cache-hit }}" != "true" ]; then
echo "Cache miss or partial hit, cleaning build directory to avoid stale JDK paths..."
rm -rf build/linux
fi
flutter build linux --debug
- name: Cache AppImageTool
uses: actions/cache@v5
with:
path: appimagetool-x86_64.AppImage
key: ${{ runner.os }}-appimagetool-continuous
restore-keys: |
${{ runner.os }}-appimagetool-
- name: Download AppImageTool if missing
run: |
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget -O appimagetool-x86_64.AppImage https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
else
echo "AppImageTool present via cache; skip download"
fi
warm-caches-windows:
name: Warm caches (Windows)
runs-on: windows-2022
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
- name: Setup Flutter (cached)
id: cache_flutter_windows
uses: subosito/flutter-action@v2
with:
flutter-version-file: .flutter-version
channel: 'main'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
cache-path: '${{ runner.tool_cache }}/flutter'
- name: Flutter precache (Windows)
run: |
flutter config --enable-windows-desktop
flutter precache --windows
- name: Cache Pub dependencies
uses: actions/cache@v5
with:
path: ~\AppData\Local\Pub\Cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Get dependencies
run: |
flutter pub get
- name: Cache Visual Studio
id: cache_vs_windows
uses: actions/cache@v5
with:
path: C:\Users\runneradmin\AppData\Local\Microsoft\VisualStudio
key: ${{ runner.os }}-vs-state-v2-debug-${{ hashFiles('pubspec.lock', '**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-vs-state-v2-debug-
- name: Clear stale Windows CMake build
run: |
Remove-Item -Recurse -Force build/windows -ErrorAction SilentlyContinue
- name: Build Windows (Debug)
if: ${{ steps.cache_vs_windows.outputs.cache-hit != 'true' || steps.cache_flutter_windows.outputs.cache-hit != 'true' }}
env:
CMAKE_INCLUDE_PATH: ${{ env.JAVA_HOME }}\include;${{ env.JAVA_HOME }}\include\win32
run: |
flutter build windows --debug
warm-caches-macos:
name: Warm caches (macOS)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Select Xcode 26.1.1
run: |
sudo xcode-select -s /Applications/Xcode_26.1.1.app
xcodebuild -version
- name: Setup Flutter (cached)
id: cache_flutter_macos
uses: subosito/flutter-action@v2
with:
flutter-version-file: .flutter-version
channel: 'main'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:'
cache-path: '${{ runner.tool_cache }}/flutter'
- name: Flutter precache (macOS & iOS)
run: |
flutter config --enable-macos-desktop
flutter precache --macos --ios
- name: Cache Pub dependencies
uses: actions/cache@v5
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-cache-${{ hashFiles('pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-cache-
- name: Get dependencies
run: |
flutter pub get
- name: Cache CocoaPods
id: cache_pods_macos
uses: actions/cache@v5
with:
path: |
ios/Pods
macos/Pods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('pubspec.lock', 'ios/Podfile', 'macos/Podfile') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods dependencies (no build)
if: ${{ steps.cache_pods_macos.outputs.cache-hit != 'true' || steps.cache_flutter_macos.outputs.cache-hit != 'true' }}
run: |
if [ -f ios/Podfile ]; then
cd ios
pod install --repo-update
cd -
fi
if [ -f macos/Podfile ]; then
cd macos
pod install --repo-update
cd -
fi
- name: Cache Xcode DerivedData
id: cache_xcode_macos
uses: actions/cache@v5
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-xcode-debug-${{ hashFiles('pubspec.lock', '**/project.pbxproj') }}
restore-keys: |
${{ runner.os }}-xcode-debug-
- name: Build macOS (Debug)
if: ${{ steps.cache_xcode_macos.outputs.cache-hit != 'true' || steps.cache_pods_macos.outputs.cache-hit != 'true' || steps.cache_flutter_macos.outputs.cache-hit != 'true' }}
run: |
flutter build macos --debug