Build Flet App #59
Workflow file for this run
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
| # source: https://github.com/ndonkoHenri/flet-github-action-workflows/blob/main/.github/workflows/apk-build.yml | |
| name: APK Build | |
| on: | |
| # Runs on push to any of the below branches | |
| # push: | |
| # branches: | |
| # - main | |
| # Runs on pull request events that target one of the below branches | |
| # pull_request: | |
| # branches: | |
| # - main | |
| # 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.85.2 | |
| # 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: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install system dependencies (GTK) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtk-3-dev | |
| - 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: Install Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.41.7" | |
| channel: stable | |
| - name: Flet Build APK | |
| run: | | |
| flet build apk --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v4.3.4 # https://github.com/marketplace/actions/upload-a-build-artifact | |
| with: | |
| name: apk-build-artifact # the name of the artifact | |
| path: build/apk # location of Flet build output | |
| if-no-files-found: error # Fail the action with an error message if no files are found | |
| overwrite: false # If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will fail if an artifact for the given name already exists. Does not fail if the artifact does not exist. |