Flet Build #115
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Flet Build | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # ┌───────────── minute (0 - 59) | |
| # │ ┌───────────── hour (0 - 23) | |
| # │ │ ┌───────────── day of the month (1 - 31) | |
| # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | |
| # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | |
| # │ │ │ │ │ | |
| # * * * * * | |
| - cron: '0 12 * * *' | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| paths-ignore: | |
| - 'LICENSE' | |
| - 'README.md' | |
| pull_request: | |
| paths-ignore: | |
| - 'LICENSE' | |
| - 'README.md' | |
| #concurrency: | |
| # PRs share a group (PR number) → newer PR runs cancel older ones. | |
| # Push/dispatch runs use unique run_id → nothing gets cancelled. | |
| # group: build-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }} | |
| # cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| env: | |
| UV_PYTHON: 3.12 | |
| PYTHONUTF8: 1 | |
| SCRIPTS: "${{ github.workspace }}/.github/workflows/scripts" | |
| # https://docs.flet.dev/publish/#versioning | |
| BUILD_NUMBER: 1 | |
| BUILD_VERSION: 1.0.0 | |
| # https://docs.flet.dev/reference/environment-variables | |
| FLET_CLI_NO_RICH_OUTPUT: 1 | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install Linux dependencies | |
| shell: bash | |
| run: | | |
| sudo apt update --allow-releaseinfo-change | |
| sudo apt-get install -y --no-install-recommends \ | |
| clang \ | |
| ninja-build \ | |
| libgtk-3-dev \ | |
| libasound2-dev \ | |
| libmpv-dev \ | |
| mpv \ | |
| libgstreamer1.0-dev \ | |
| libgstreamer-plugins-base1.0-dev \ | |
| libgstreamer-plugins-bad1.0-dev \ | |
| gstreamer1.0-plugins-base \ | |
| gstreamer1.0-plugins-good \ | |
| gstreamer1.0-plugins-bad \ | |
| gstreamer1.0-plugins-ugly \ | |
| gstreamer1.0-libav \ | |
| gstreamer1.0-tools \ | |
| gstreamer1.0-x \ | |
| gstreamer1.0-alsa \ | |
| gstreamer1.0-gl \ | |
| gstreamer1.0-gtk3 \ | |
| gstreamer1.0-qt5 \ | |
| gstreamer1.0-pulseaudio \ | |
| pkg-config \ | |
| libsecret-1-0 \ | |
| libsecret-1-dev | |
| sudo apt-get clean | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" "$GITHUB_STEP_SUMMARY" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build Linux | |
| run: | | |
| uv run flet build linux --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload Linux Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: linux-build-artifact | |
| path: build/linux | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build macOS | |
| run: | | |
| uv run flet build macos --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload macOS Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: macos-build-artifact | |
| path: build/macos | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build Windows | |
| shell: bash | |
| run: | | |
| uv run flet build windows --yes --verbose --no-rich-output --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload Windows Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: windows-build-artifact | |
| path: build/windows | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-aab: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu, macos, windows ] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build AAB | |
| shell: bash | |
| run: | | |
| uv run flet build aab --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload AAB Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: aab-build-${{ matrix.os }}-artifact | |
| path: build/aab | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-apk: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu, macos, windows ] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build APK | |
| shell: bash | |
| run: | | |
| uv run flet build apk --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: apk-build-${{ matrix.os }}-artifact | |
| path: build/apk | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-ipa: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build IPA | |
| run: | | |
| uv run flet build ipa --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload IPA Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: ipa-build-artifact | |
| path: build/ipa | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-web: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu, macos, windows ] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Get Flet & Flutter versions | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run python -c "import flet.version; print(f'FLET_VERSION={flet.version.flet_version}'); print(f'FLUTTER_VERSION={flet.version.flutter_version}')" | tee -a "$GITHUB_ENV" | |
| - name: Pin flet* versions in pyproject.toml to ${{ env.FLET_VERSION }} | |
| shell: bash | |
| run: | | |
| uv run "$SCRIPTS/pin_flet_deps.py" pyproject.toml $FLET_VERSION | |
| - name: Flet Build Web | |
| shell: bash | |
| run: | | |
| uv run flet build web --yes --verbose | |
| - name: Upload Web Artifact | |
| uses: actions/upload-artifact@v5.0.0 | |
| with: | |
| name: web-build-${{ matrix.os }}-artifact | |
| path: build/web | |
| if-no-files-found: warn | |
| overwrite: false |