CI/CD & releases¶
Three GitHub Actions workflows live in .github/workflows/.
| Workflow | File | Runs on | Does |
|---|---|---|---|
| CI/CD | ci.yml |
code changes pushed to main or opened as PRs, manual |
Analyze, test, build three APKs, prune old artifacts |
| Docs | docs.yml |
changes to docs/ or mkdocs.yml |
Builds this site; deploys it to Cloudflare Pages from main |
| Release | release.yml |
a pushed v* tag, manual |
Builds the three APKs and publishes a GitHub Release |
Docs-only changes skip the app build
ci.yml ignores changes that only touch docs/, mkdocs.yml, Markdown files or the docs/release workflows,
so editing documentation never rebuilds the APKs.
App pipeline (ci.yml)¶
flowchart LR
T["test<br/>flutter analyze<br/>flutter test --coverage"] --> U["build-android (user)"]
T --> CH["build-android (chef)"]
T --> AD["build-android (admin)"]
U & CH & AD --> C["cleanup-artifacts<br/>keep last 2 PRs"]
| Job | Runner | Output artifact |
|---|---|---|
test |
ubuntu | coverage-lcov |
build-android (matrix: user, chef, admin) |
ubuntu + Java 17 | mealmind-<app>-apk |
cleanup-artifacts |
ubuntu | none |
- Analyze & test:
flutter analyzefails only on errors; warnings and infos are reported but don't block.flutter test --coveragemust pass before any build starts. - Build: the three APKs build in parallel with
flutter build apk --release --flavor <app> -t lib/main_<app>.dart. Download them from the run's Summary page. - Cleanup: keeps artifacts from the newest run of each of the 2 most recent pull requests and from the 2 most recent non-PR runs, and deletes everything older from this workflow. Every artifact also expires after 14 days. The job is skipped for PRs from forks, since their token can't delete artifacts.
Runner tuning
The build job frees disk space first and caps Gradle's memory through ~/.gradle/gradle.properties.
The project's own android/gradle.properties asks for more RAM than a hosted runner has.
Releases¶
Releases are published from a version tag. The version: in pubspec.yaml should match it.
The Release workflow then:
- builds the user, chef and admin APKs from the tagged commit,
- renames them to
mealmind-<app>-<tag>.apkand writesSHA256SUMS.txt, - creates the GitHub Release MealMind <tag> with a download table plus auto-generated notes from the merged PRs.
To re-upload the files for an existing tag, run Release manually from the Actions tab and enter the tag.
Docs pipeline (docs.yml)¶
Pull requests build the site with mkdocs build --strict, so broken links fail the check. Pushes to main also
deploy it to Cloudflare Pages (project mealmind-docs). The deploy needs two repository secrets:
CLOUDFLARE_API_TOKEN (with Cloudflare Pages: Edit) and CLOUDFLARE_ACCOUNT_ID.
Preview the site locally: