This commit is contained in:
Dmitry 2025-11-20 01:02:32 +03:00
parent 0de8356cc9
commit b93de06cc0

View file

@ -68,29 +68,30 @@ jobs:
run: |
apt-get update && apt-get install -y rsync openssh-client jq
- name: Setup Flutter
uses: https://github.com/subosito/flutter-action@v2
- name: Restore Flutter cache
uses: actions/cache@v3
with:
flutter-version: '3.35.5'
channel: 'stable'
cache: false
path: /opt/flutter
key: flutter-${{ runner.os }}-${{ hashFiles('**/pubspec.yaml') }}
restore-keys: |
flutter-${{ runner.os }}-
- name: Ensure Flutter directory is a git repo
- name: Install Flutter if missing
run: |
if [ -z "$FLUTTER_ROOT" ]; then
echo "FLUTTER_ROOT is empty, flutter-action probably didn't run correctly"
exit 1
fi
cd "$FLUTTER_ROOT"
if [ ! -d .git ]; then
echo "Initializing .git in $FLUTTER_ROOT"
git init
if [ ! -d /opt/flutter/bin ]; then
echo "Flutter not found in cache. Cloning..."
git clone https://github.com/flutter/flutter.git /opt/flutter
cd /opt/flutter
git checkout 3.35.5
else
echo ".git already exists in $FLUTTER_ROOT"
echo "Using cached Flutter"
fi
echo "FLUTTER_ROOT=/opt/flutter" >> $GITHUB_ENV
echo "/opt/flutter/bin" >> $GITHUB_PATH
flutter --version
- name: Setup SSH
run: |
mkdir -p ~/.ssh