Skip to content

Add flet-mcp: MCP server for LLM agents #1148

Add flet-mcp: MCP server for LLM agents

Add flet-mcp: MCP server for LLM agents #1148

Workflow file for this run

name: Flet Build Test
on:
push:
branches-ignore:
- main
paths:
- '.github/workflows/flet-build-test.yml'
- '.github/workflows/flet-build-test-matrix.yml'
- '.fvmrc'
- 'client/**'
- 'sdk/python/packages/**'
- 'packages/flet/**'
- 'sdk/python/examples/apps/flet_build_test/**'
pull_request:
paths:
- '.github/workflows/flet-build-test.yml'
- '.github/workflows/flet-build-test-matrix.yml'
- '.fvmrc'
- 'client/**'
- 'sdk/python/packages/**'
- 'packages/flet/**'
- 'sdk/python/examples/apps/flet_build_test/**'
workflow_dispatch:
inputs:
python_version:
description: "Bundled Python version to test"
type: choice
required: true
default: all
options:
- all
- "3.12"
- "3.13"
- "3.14"
extra_build_args:
description: "Extra CLI args appended to `flet build` command (ex: --template-ref 0.1.0)"
required: false
default: ""
extra_pack_args:
description: "Extra CLI args appended to `flet pack` command (ex: --icon path/to/icon)"
required: false
default: ""
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.head.ref || github.ref_name }}
cancel-in-progress: true
env:
ROOT: "${{ github.workspace }}"
SDK_PYTHON: "${{ github.workspace }}/sdk/python"
SCRIPTS: "${{ github.workspace }}/.github/scripts"
UV_PYTHON: 3.12
PYTHONUTF8: 1
# https://flet.dev/docs/reference/environment-variables
FLET_CLI_NO_RICH_OUTPUT: 1
# Extra args passed via workflow_dispatch (empty for push/PR)
FLET_PACK_EXTRA_ARGS: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_pack_args || '' }}
jobs:
# The build matrix is split into one reusable-workflow call per supported
# bundled CPython release. This makes the Actions UI group jobs by Python
# version (each call renders as its own "Matrix: build" card) and lets
# `workflow_dispatch` target a single version via the `python_version`
# input. push/pull_request runs always fire all three.
build-3-12:
if: github.event_name != 'workflow_dispatch' || inputs.python_version == 'all' || inputs.python_version == '3.12'
name: Python 3.12
uses: ./.github/workflows/flet-build-test-matrix.yml
with:
python_version: "3.12"
extra_build_args: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_build_args || '' }}
build-3-13:
if: github.event_name != 'workflow_dispatch' || inputs.python_version == 'all' || inputs.python_version == '3.13'
name: Python 3.13
uses: ./.github/workflows/flet-build-test-matrix.yml
with:
python_version: "3.13"
extra_build_args: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_build_args || '' }}
build-3-14:
if: github.event_name != 'workflow_dispatch' || inputs.python_version == 'all' || inputs.python_version == '3.14'
name: Python 3.14
uses: ./.github/workflows/flet-build-test-matrix.yml
with:
python_version: "3.14"
extra_build_args: ${{ github.event_name == 'workflow_dispatch' && inputs.extra_build_args || '' }}
pack:
name: Pack (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
env:
FLET_DESKTOP_FLAVOR: full
strategy:
fail-fast: false
matrix:
include:
- name: linux
runner: ubuntu-latest
- name: macos
runner: macos-26
- name: windows
runner: windows-2025-vs2026
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Setup uv
uses: astral-sh/setup-uv@v8.2.0
- name: Setup Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
with:
path: '.fvmrc'
cache: true
- name: Patch versions
shell: bash
run: |
source "${SCRIPTS}/update_build_version.sh"
source "${SCRIPTS}/common.sh"
patch_python_package_versions
- name: Install Linux dependencies
if: matrix.name == 'linux'
shell: bash
run: |
sudo apt update --allow-releaseinfo-change
LINUX_DEPS="$(uv run --project sdk/python/packages/flet-cli flet --version --json | jq -r '.linux_dependencies | join(" ")')"
sudo apt-get install -y --no-install-recommends $LINUX_DEPS
sudo apt-get clean
- name: Prepare local desktop client archive
shell: bash
run: |
set -euo pipefail
APP_DIR="${SDK_PYTHON}/packages/flet-desktop/src/flet_desktop/app"
mkdir -p "${APP_DIR}"
rm -rf "${APP_DIR:?}"/*
pushd client
case "${{ matrix.name }}" in
linux)
flutter build linux --build-name="$PKG_VER" --build-number="$BUILD_NUM"
rm -rf build/linux/x64/release/flet
mv build/linux/x64/release/bundle build/linux/x64/release/flet
tar -czvf "${APP_DIR}/flet-linux-ubuntu24.04-amd64.tar.gz" -C build/linux/x64/release flet
;;
macos)
flutter build macos --build-name="$PKG_VER" --build-number="$BUILD_NUM"
tar -czvf "${APP_DIR}/flet-macos.tar.gz" -C build/macos/Build/Products/Release Flet.app
;;
windows)
flutter build windows --build-name="$PKG_VER" --build-number="$BUILD_NUM"
RUNNER_DIR="${ROOT}/client/build/windows/x64/runner"
RELEASE_DIR="${RUNNER_DIR}/Release"
cp "${WINDIR}/system32/msvcp140.dll" "$RELEASE_DIR"
cp "${WINDIR}/system32/vcruntime140.dll" "$RELEASE_DIR"
cp "${WINDIR}/system32/vcruntime140_1.dll" "$RELEASE_DIR"
rm -rf "${RUNNER_DIR}/flet"
mv "$RELEASE_DIR" "${RUNNER_DIR}/flet"
pushd "${RUNNER_DIR}"
7z a "${APP_DIR}/flet-windows.zip" "flet"
popd
;;
esac
popd
- name: Pack app
shell: bash
working-directory: sdk/python/examples/apps/flet_build_test
run: |
echo "FLET_PACK_EXTRA_ARGS='${FLET_PACK_EXTRA_ARGS}'"
uv run --with pyinstaller flet pack src/main.py --yes --name flet-pack-test --distpath dist $FLET_PACK_EXTRA_ARGS
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }}-pack-artifact
path: sdk/python/examples/apps/flet_build_test/dist
if-no-files-found: error
overwrite: false