fix(setup-flutter): avoid deleting flutter.version.json when already cached to prevent concurrent pub failures
Update README Actions Table / update-readme (push) Successful in 6s
Update README Actions Table / update-readme (push) Successful in 6s
This commit is contained in:
@@ -72,6 +72,7 @@ runs:
|
||||
}
|
||||
git -C "$SDK_DIR" config --global --add safe.directory "$SDK_DIR" || true
|
||||
git -C "$SDK_DIR" checkout "$TARGET_VERSION"
|
||||
rm -f "$SDK_DIR/bin/cache/flutter.version.json"
|
||||
else
|
||||
git -C "$SDK_DIR" config --global --add safe.directory "$SDK_DIR" || true
|
||||
CURRENT_COMMIT=$(git -C "$SDK_DIR" rev-parse HEAD 2>/dev/null || true)
|
||||
@@ -79,6 +80,7 @@ runs:
|
||||
echo "Checking out Flutter $TARGET_VERSION..."
|
||||
git -C "$SDK_DIR" fetch origin "$TARGET_VERSION" --depth=1 2>/dev/null || git -C "$SDK_DIR" fetch origin
|
||||
git -C "$SDK_DIR" checkout "$TARGET_VERSION"
|
||||
rm -f "$SDK_DIR/bin/cache/flutter.version.json"
|
||||
else
|
||||
echo "Flutter SDK already at $TARGET_VERSION. Ready to use."
|
||||
fi
|
||||
@@ -96,9 +98,15 @@ runs:
|
||||
echo "$SDK_DIR/bin" >> "$GITHUB_PATH"
|
||||
|
||||
if [ "${{ inputs.enable_windowing }}" = "true" ]; then
|
||||
if ! grep -q '"enable-windowing":[[:space:]]*true' "$HOME/.flutter_settings" 2>/dev/null; then
|
||||
"$SDK_DIR/bin/flutter" config --enable-windowing
|
||||
fi
|
||||
fi
|
||||
if [ ! -f "$SDK_DIR/bin/cache/flutter.version.json" ]; then
|
||||
"$SDK_DIR/bin/flutter" --version
|
||||
else
|
||||
cat "$SDK_DIR/bin/cache/flutter.version.json"
|
||||
fi
|
||||
|
||||
rm -rf "$LOCK_DIR" || true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user