Skip to content

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
  1. Analyze & test: flutter analyze fails only on errors; warnings and infos are reported but don't block. flutter test --coverage must pass before any build starts.
  2. 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.
  3. 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.

git checkout main && git pull
git tag v1.1.0
git push origin v1.1.0

The Release workflow then:

  1. builds the user, chef and admin APKs from the tagged commit,
  2. renames them to mealmind-<app>-<tag>.apk and writes SHA256SUMS.txt,
  3. 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:

python -m venv .venv && source .venv/bin/activate
pip install -r docs/requirements.txt
mkdocs serve          # http://127.0.0.1:8000