merge 'main' into 'example' #6
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: Desktop and Mobile Builds (Linux, macOS, Windows, AAB, APK, IPA) | |
| on: | |
| # Runs on push to any of the below branches | |
| push: | |
| branches: | |
| - example | |
| # Runs on pull request events that target one of the below branches | |
| pull_request: | |
| branches: | |
| - example | |
| # Allows you to run this workflow manually from the Actions tab of the repository | |
| workflow_dispatch: | |
| env: | |
| # https://flet.dev/docs/publish#versioning | |
| BUILD_NUMBER: 1 | |
| BUILD_VERSION: 1.0.0 | |
| # Python version to use | |
| PYTHON_VERSION: 3.12.8 | |
| # flet-cli version to install for `flet build` | |
| FLET_CLI_VERSION: 0.27.5 | |
| # Ensures Python uses UTF-8 encoding by default | |
| PYTHONUTF8: 1 | |
| # Disables rich text formatting in Flet CLI output | |
| FLET_CLI_NO_RICH_OUTPUT: 1 | |
| # Disables progress bars when using UV | |
| UV_NO_PROGRESS: 1 | |
| jobs: | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$FLET_CLI_VERSION | |
| - name: Patch for linux build | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y ninja-build libgtk-3-dev | |
| - name: Flet Build Linux | |
| run: | | |
| flet build linux --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload Linux Artifact | |
| uses: actions/[email protected] | |
| 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 Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$FLET_CLI_VERSION | |
| - name: Flet Build macOS | |
| run: | | |
| flet build macos --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload macOS Artifact | |
| uses: actions/[email protected] | |
| 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 Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$env:FLET_CLI_VERSION | |
| - name: Flet Build Windows | |
| run: | | |
| flet build windows --verbose --no-rich-output --build-number=$env:BUILD_NUMBER --build-version=$env:BUILD_VERSION | |
| - name: Upload Windows Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: windows-build-artifact | |
| path: build/windows | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-aab: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$FLET_CLI_VERSION | |
| - name: Flet Build AAB | |
| run: | | |
| flet build aab --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload AAB Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: aab-build-artifact | |
| path: build/aab | |
| if-no-files-found: warn | |
| overwrite: false | |
| build-apk: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$FLET_CLI_VERSION | |
| - name: Flet Build APK | |
| run: | | |
| flet build apk --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload APK Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: apk-build-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 Python ${{ env.PYTHON_VERSION }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install flet-cli ${{ env.FLET_CLI_VERSION }} | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install flet-cli==$FLET_CLI_VERSION | |
| - name: Flet Build IPA | |
| run: | | |
| flet build ipa --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload IPA Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: ipa-build-artifact | |
| path: build/ipa | |
| if-no-files-found: warn | |
| overwrite: false |