Update build.yml to refine push and pull_request triggers #14
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: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| paths-ignore: | |
| - '.github/dependabot.yml' | |
| - 'LICENSE' | |
| - 'README.md' | |
| pull_request: | |
| paths-ignore: | |
| - '.github/dependabot.yml' | |
| - 'LICENSE' | |
| - 'README.md' | |
| env: | |
| UV_PYTHON: 3.12 | |
| PYTHONUTF8: 1 | |
| CMAKE_VERSION: 3.22.1 | |
| # https://docs.flet.dev/publish/#versioning | |
| BUILD_NUMBER: 1 | |
| BUILD_VERSION: 1.0.0 | |
| 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 | |
| sudo apt-get clean | |
| - name: Flet Build Linux | |
| run: | | |
| uv venv | |
| uv run flet build linux --yes --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 uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Flet Build macOS | |
| run: | | |
| uv venv | |
| uv run flet build macos --yes --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 uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Flet Build Windows | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run flet build windows --yes --verbose --no-rich-output --build-number=$BUILD_NUMBER --build-version=$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: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu, macos, windows ] | |
| runs-on: ${{ matrix.os }}-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: ${{ env.CMAKE_VERSION }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Flet Build AAB | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run flet build aab --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload AAB Artifact | |
| uses: actions/[email protected] | |
| 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 cmake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: ${{ env.CMAKE_VERSION }} | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Flet Build APK | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run flet build apk --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION | |
| - name: Upload APK Artifact | |
| uses: actions/[email protected] | |
| 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: Flet Build IPA | |
| run: | | |
| uv venv | |
| uv run flet build ipa --yes --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 | |
| 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: Flet Build Web | |
| shell: bash | |
| run: | | |
| uv venv | |
| uv run flet build web --yes --verbose | |
| - name: Upload Web Artifact | |
| uses: actions/[email protected] | |
| with: | |
| name: web-build-${{ matrix.os }}-artifact | |
| path: build/web | |
| if-no-files-found: warn | |
| overwrite: false |