Skip to content

Commit b0c5d4c

Browse files
committed
refactor build commands and update project metadata
1 parent e05077c commit b0c5d4c

3 files changed

Lines changed: 30 additions & 39 deletions

File tree

.github/workflows/all-builds.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ env:
99
UV_PYTHON: 3.12
1010
PYTHONUTF8: 1
1111

12-
# https://docs.flet.dev/publish/
13-
BUILD_NUMBER: 1
14-
BUILD_VERSION: 1.0.0
15-
1612
# https://docs.flet.dev/reference/environment-variables
1713
FLET_CLI_NO_RICH_OUTPUT: 1
1814

@@ -27,46 +23,46 @@ jobs:
2723
# -------- Desktop --------
2824
- name: linux
2925
runner: ubuntu-latest
30-
build_cmd: "flet build linux --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
26+
build_cmd: "flet build linux"
3127
artifact_path: build/linux
3228
needs_linux_deps: true
3329

3430
- name: macos
3531
runner: macos-latest
36-
build_cmd: "flet build macos --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
32+
build_cmd: "flet build macos"
3733
artifact_path: build/macos
3834
needs_linux_deps: false
3935

4036
- name: windows
4137
runner: windows-latest
42-
build_cmd: "flet build windows --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
38+
build_cmd: "flet build windows"
4339
artifact_path: build/windows
4440
needs_linux_deps: false
4541

4642
# -------- Android --------
4743
- name: aab
4844
runner: ubuntu-latest
49-
build_cmd: "flet build aab --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
45+
build_cmd: "flet build aab"
5046
artifact_path: build/aab
5147
needs_linux_deps: false
5248

5349
- name: apk
5450
runner: ubuntu-latest
55-
build_cmd: "flet build apk --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
51+
build_cmd: "flet build apk"
5652
artifact_path: build/apk
5753
needs_linux_deps: false
5854

5955
# -------- iOS --------
6056
- name: ipa
6157
runner: macos-latest
62-
build_cmd: "flet build ipa --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
58+
build_cmd: "flet build ipa"
6359
artifact_path: build/ipa
6460
needs_linux_deps: false
6561

6662
# -------- Web --------
6763
- name: web
6864
runner: ubuntu-latest
69-
build_cmd: "flet build web --yes --verbose"
65+
build_cmd: "flet build web"
7066
artifact_path: build/web
7167
needs_linux_deps: false
7268

@@ -91,10 +87,11 @@ jobs:
9187
pkg-config libsecret-1-0 libsecret-1-dev
9288
sudo apt-get clean
9389
90+
9491
- name: Build app
9592
shell: bash
9693
run: |
97-
uv run ${{ matrix.build_cmd }}
94+
uv run ${{ matrix.build_cmd }} --yes --verbose
9895
9996
- name: Upload Artifact
10097
uses: actions/upload-artifact@v5.0.0

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@ Feel free to reuse them and customize to your specific usecases and needs.
1515
| [`pyproject.toml`](pyproject.toml) | Example Flet project configuration |
1616
| [`src/main.py`](src/main.py) | Example Flet app to test the workflows |
1717

18-
## Quick start
19-
18+
**Quick start:**
2019
1. Copy the workflow(s) you need into your own repository under `.github/workflows/`.
21-
2. Ensure your project has a valid `pyproject.toml` and Flet app source.
22-
3. Push to GitHub or run manually from the [Actions](/actions) tab.
20+
2. Push to GitHub or run manually from the Actions tab of your repository.
2321

2422
## Workflow details
2523

2624
### `all-builds.yml`
2725

28-
- Uses `uv` as package manager/installer.
26+
- Uses `uv` for Python and command execution.
2927
- Uses a matrix strategy to build: `linux`, `macos`, `windows`, `aab`, `apk`, `ipa`, `web`.
3028
- Uploads one artifact per target with the pattern `<target>-build-artifact`.
3129
- Includes a Linux dependency installation step only when needed for Linux desktop builds.
@@ -34,30 +32,28 @@ Feel free to reuse them and customize to your specific usecases and needs.
3432
### `web-build-and-github-pages-deploy.yml`
3533

3634
- Builds the web app with:
37-
- `--base-url ${GITHUB_REPOSITORY#*/}`: which sets the base URL to the repository name.
38-
- `--route-url-strategy hash`: which uses the hash URL strategy; useful when deploying to static hosts without SPA support, like GitHub Pages.
39-
- Uploads the web output as a Pages artifact.
35+
- `--base-url ${GITHUB_REPOSITORY#*/}` (repository name as base URL)
36+
- `--route-url-strategy hash` (good for static hosts like GitHub Pages)
37+
- Uploads `build/web` as a Pages artifact named `web-build-artifact` with `retention-days: 20`.
4038
- Deploys only on push to the `main` branch.
4139
- Supports manual runs via `workflow_dispatch`.
4240

4341
## Common customization points
4442

4543
- Triggers: adjust `push`, `pull_request`, and `workflow_dispatch` for your flow.
4644
- Matrix targets: remove entries you do not need from `all-builds.yml`.
47-
- Versioning:
48-
- `BUILD_NUMBER`
49-
- `BUILD_VERSION`
45+
- Versioning: [`BUILD_NUMBER`](https://docs.flet.dev/publish/#build-number), [`BUILD_VERSION` ](https://docs.flet.dev/publish/#build-version).
5046
- Python/tooling:
51-
- `UV_PYTHON`
52-
- `FLET_CLI_NO_RICH_OUTPUT`
53-
- `PYTHONUTF8`
47+
- `UV_PYTHON` - the Python version to use
48+
- [`FLET_CLI_NO_RICH_OUTPUT`](https://docs.flet.dev/reference/environment-variables/#flet_cli_skip_flutter_doctor) - disables console rich output
49+
- [`PYTHONUTF8`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONUTF8) - enables UTF-8 encoding for Python. Useful in Windows builds.
5450
- Build commands: customize `flet build ...` flags to match your app requirements.
5551

5652
## Notes
5753

58-
- The workflows run with `--verbose` to make troubleshooting easier.
54+
- The workflows run with `--verbose` to make `flet build` troubleshooting easier.
5955
- Linux desktop builds need extra system packages, already handled in `all-builds.yml`.
60-
- You can define app/version metadata in `pyproject.toml` if preferred. ([docs](https://docs.flet.dev/publish/#versioning))
56+
- You can define app metadata (like `BUILD_NUMBER` and `BUILD_VERSION`) in the `pyproject.toml` if preferred. ([docs](https://docs.flet.dev/publish/#versioning))
6157

6258
## Resources
6359

@@ -67,6 +63,5 @@ Feel free to reuse them and customize to your specific usecases and needs.
6763

6864
## Contributing
6965

70-
Contributions are welcome and appreciated! 😄
71-
72-
Please open an issue or PR if you have any feedback or suggestions.
66+
Contributions are welcome.
67+
Open an issue or PR with improvements, fixes, or suggestions.

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[project]
2-
name = "flet-gh-action-workflows"
3-
version = "0.1.0"
2+
name = "flet-gha-example"
3+
version = "0.1.0" # Build Version. Update for each new release of your app.
44
description = "A simple Flet app, built by GitHub Actions."
55
readme = "README.md"
66
requires-python = ">=3.10"
77
authors = [
8-
{ name = "Flet developer", email = "you@example.com" }
8+
{ name = "TheEthicalBoy", email = "me@ethicalboy.com" }
99
]
1010
dependencies = [
1111
"flet==0.80.5"
@@ -16,12 +16,11 @@ dev = [
1616
"flet[all]==0.80.5",
1717
]
1818

19+
# Docs: https://docs.flet.dev/publish
20+
1921
[tool.flet]
20-
org = "com.mycompany"
21-
product = "flet-gh-pages-example"
22-
artifact = "flet_gh_pages_example"
23-
company = "Flet"
24-
copyright = "Copyright (C) 2026 by Flet"
22+
build_number = 1
23+
product = "Flet GHA Example"
2524

2625
[tool.flet.app]
2726
path = "src"

0 commit comments

Comments
 (0)