Self-hosted fitness tracker. Log workouts, track nutrition, and monitor progress. Docker deployment, mobile-friendly.
chore(ci): merge mobile + backend/web pipelines, unify release tags (#77)
Carter5d06d4931d62
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 7a26d1c..38c9aa0 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -1,33 +1,42 @@-name: Backend + Web CI+name: CI-# Backend (Go) + web (Vite) tests, the integrated Playwright e2e, image builds, and the-# Fly deploy — one workflow because build/deploy are gated on the test jobs via `needs:`.-# Mobile has its own pipeline (mobile-ci.yml); mobile/docs/markdown-only changes don't-# touch anything here, so `paths-ignore` skips the whole run for them.+# Backend (Go) + web (Vite) + mobile (Expo) + shared package tests, the integrated+# Playwright e2e, image builds, and the Fly deploy — one workflow, gated by a shared+# `changes` job so it never skips itself the way a top-level `paths:` trigger filter+# would (that's the mobile-ci.yml pattern this replaced — see git history — and it has+# a real GH Actions trap: a workflow that's skipped-at-the-trigger-level rather than+# skipped-at-the-job-level can leave a required check permanently "waiting for status"+# on PRs that don't touch its paths). docs/markdown-only changes still skip the whole+# run via `paths-ignore`, since nothing here depends on them.## Per-job filtering (the `changes` job + dorny/paths-filter): a backend-only change skips-# the web unit job, and a web-only change skips the Go + version-smoke jobs. The image-build-# and deploy jobs stay eligible regardless — they're guarded with `!failure() && !cancelled()`-# so a *skipped* (not failed) test dependency doesn't cascade into skipping the build/deploy-# gate. On main/tags every test job runs unconditionally, so filtering never weakens deploys.+# the web/mobile unit jobs, a web-only change skips the Go + version-smoke + mobile jobs,+# and so on. The image-build and deploy jobs stay eligible regardless — they're guarded+# with `!failure() && !cancelled()` so a *skipped* (not failed) test dependency doesn't+# cascade into skipping the build/deploy gate. On main/tags every test job runs+# unconditionally, so filtering never weakens deploys.on:push:branches: ['**']tags: ['v*']paths-ignore:- - 'mobile/**'- 'docs/**'- '**.md'pull_request:branches: [main]paths-ignore:- - 'mobile/**'- 'docs/**'- '**.md'+# Least privilege — nothing in this workflow needs to write via GITHUB_TOKEN (image pushes and+# the Fly deploy use their own secrets). Matches mobile-ci.yml's prior explicit read-only scope,+# now applied workflow-wide since mobile checks run here too.+permissions:+ contents: read+jobs:# Which domains changed? Gates the fast unit-test jobs below so a backend-only PR doesn't- # run the web suite (and vice-versa). ci.yml is in both filters so workflow edits run all.+ # run the web/mobile suites (and vice-versa). ci.yml is in both filters so workflow edits run all.changes:name: Detect changed areasruns-on: ubuntu-latest@@ -36,6 +45,7 @@ jobs:outputs:backend: ${{ steps.filter.outputs.backend }}web: ${{ steps.filter.outputs.web }}+ mobile: ${{ steps.filter.outputs.mobile }}steps:- uses: actions/checkout@v4- uses: dorny/paths-filter@v3@@ -51,6 +61,12 @@ jobs:web:- 'web/**'- '.github/workflows/ci.yml'+ mobile:+ - 'mobile/**'+ - 'packages/shared/**'+ - 'package.json'+ - 'package-lock.json'+ - '.github/workflows/ci.yml'test:name: Go unit tests@@ -94,6 +110,44 @@ jobs:path: web/coverage/retention-days: 7+ mobile:+ name: Mobile + shared checks+ needs: changes+ if: >-+ needs.changes.outputs.mobile == 'true' ||+ github.ref == 'refs/heads/main' ||+ startsWith(github.ref, 'refs/tags/')+ runs-on: ubuntu-latest+ timeout-minutes: 20+ # Job-level (not workflow-level) so a superseded mobile run gets canceled on rapid pushes —+ # mobile-ci.yml had this at the workflow level; scoping it to just this job here avoids ever+ # risking cancellation of the build-backend/build-frontend/deploy-demo jobs on a main push.+ concurrency:+ group: ci-mobile-${{ github.ref }}+ cancel-in-progress: true+ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-node@v4+ with:+ node-version: '20'+ cache: 'npm'+ # Root workspace lockfile — installs mobile + packages/shared together. (The+ # web job above keys on web/package-lock.json, a deliberately separate install.)+ cache-dependency-path: package-lock.json++ # One workspace install covers mobile + packages/shared.+ - run: npm ci++ # --- packages/shared (jest + tsc) ---+ - run: npm run shared:type-check+ - run: npm run shared:test++ # --- mobile (Expo app) ---+ - run: npm run type-check -w @lyftr/mobile+ - run: npm run lint -w @lyftr/mobile+ - run: npm run test -w @lyftr/mobile -- --ci+e2e:name: Playwright E2Eneeds: changesdiff --git a/.github/workflows/eas-build.yml b/.github/workflows/eas-build.ymlindex 9844ee7..2bb7337 100644--- a/.github/workflows/eas-build.yml+++ b/.github/workflows/eas-build.yml@@ -3,11 +3,13 @@# Two paths (matching how OSS Expo apps ship):# • TESTERS → run this workflow manually (Actions → Run workflow). EAS builds an# Android APK; you install it from the build's expo.dev page (download link + QR).-# • PUBLIC → push a `mobile-v*` tag. EAS builds the APK, and CI attaches it to a-# GitHub Release (a permanent, public "Download for Android" asset).+# • PUBLIC → push a `v*` tag (the same single tag namespace ci.yml uses for the+# web/backend release — one tag now covers every platform). EAS builds the APK, and+# CI attaches it to the GitHub Release for that tag (a permanent, public "Download+# for Android" asset) alongside the web/backend notes. See RELEASING.md.#-# Native builds are slow + consume EAS quota, so this is SEPARATE from mobile-ci.yml and-# never runs per-PR.+# Native builds are slow + consume EAS quota, so this stays a separate workflow from+# ci.yml's fast test jobs and never runs per-PR.## ── One-time setup (required before the first run) ────────────────────────────────────# 1. `cd mobile && npx eas login` then `npx eas init` (links an EAS project; writes@@ -34,7 +36,7 @@ on:options: [preview, production]push:tags:- - 'mobile-v*' # mobile releases use their own tag namespace (web/backend use v*)+ - 'v*' # unified tag namespace — same tags ci.yml builds/pushes web+backend images on# Don't run overlapping builds for the same ref — queue them instead of burning quota.concurrency:@@ -144,9 +146,13 @@ jobs:uses: softprops/action-gh-release@v2with:files: lyftr-${{ github.ref_name }}.apk- make_latest: false # separate release train; keep mobile out of the repo-wide Latest+ make_latest: false # everything currently ships as a prerelease; revisit once a stable tag landsprerelease: true # Android betas ship as prereleases (like the web betas)generate_release_notes: true+ # append_body — this release is shared with the web/backend notes (one tag, one+ # release now). Whichever of "gh release create" (manual notes) or this job runs+ # first, appending means neither overwrites the other's content.+ append_body: truebody: |### Android (side-load)Download `lyftr-${{ github.ref_name }}.apk` below. On your phone, open it anddiff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.ymldeleted file mode 100644index 8a92c7d..0000000--- a/.github/workflows/mobile-ci.yml+++ /dev/null@@ -1,60 +0,0 @@-# Mobile CI — typecheck + lint + unit/component tests for the Expo app and the shared-# package. Separate from ci.yml (backend + web + Docker/Fly) and path-filtered so it only-# runs when mobile/shared/workspace-root files change; a backend- or web-only PR skips it.-name: Mobile CI--on:- push:- branches: ['**']- paths:- - 'mobile/**'- - 'packages/shared/**'- - 'package.json'- - 'package-lock.json'- - '.github/workflows/mobile-ci.yml'- pull_request:- branches: [main]- paths:- - 'mobile/**'- - 'packages/shared/**'- - 'package.json'- - 'package-lock.json'- - '.github/workflows/mobile-ci.yml'--# Least privilege — these checks only read the repo (no token write scope).-permissions:- contents: read--# A newer push to the same branch/PR cancels the in-flight run (saves CI minutes and-# never leaves a stale result as the "latest").-concurrency:- group: mobile-ci-${{ github.ref }}- cancel-in-progress: true--jobs:- mobile:- name: Mobile + shared checks- runs-on: ubuntu-latest- timeout-minutes: 20- steps:- - uses: actions/checkout@v4-- - uses: actions/setup-node@v4- with:- node-version: '20'- cache: 'npm'- # Root workspace lockfile — installs mobile + packages/shared together. (ci.yml's- # web job keys on web/package-lock.json, a deliberately separate install.)- cache-dependency-path: package-lock.json-- # One workspace install covers mobile + packages/shared.- - run: npm ci-- # --- packages/shared (jest + tsc, previously ungated) ---- - run: npm run shared:type-check- - run: npm run shared:test-- # --- mobile (Expo app) ---- - run: npm run type-check -w @lyftr/mobile- - run: npm run lint -w @lyftr/mobile- - run: npm run test -w @lyftr/mobile -- --cidiff --git a/README.md b/README.mdindex 2a15c7b..f7fa66f 100644--- a/README.md+++ b/README.md@@ -10,7 +10,7 @@<p align="center"><a href="https://lyftr-demo.fly.dev">Live demo</a> ·<a href="https://lyftr-app.pages.dev">Docs</a> ·- <a href="https://github.com/Cawlumm/lyftr/releases?q=mobile-v">Download APK</a> ·+ <a href="https://github.com/Cawlumm/lyftr/releases/latest">Download APK</a> ·<a href="https://discord.gg/hfFWsrebQA">Discord</a></p>@@ -18,7 +18,7 @@<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License" /></a><img src="https://img.shields.io/badge/status-beta-orange" alt="Beta" /><a href="https://selfh.st/weekly/2026-04-24/"><img src="https://img.shields.io/badge/Featured%20in-selfh.st-6366f1" alt="Featured in selfh.st" /></a>- <a href="https://github.com/Cawlumm/lyftr/releases?q=mobile-v"><img src="https://img.shields.io/github/v/release/Cawlumm/lyftr?filter=mobile-v*&label=Android&logo=android&logoColor=white&color=3ddc84" alt="Android APK" /></a>+ <a href="https://github.com/Cawlumm/lyftr/releases/latest"><img src="https://img.shields.io/github/v/release/Cawlumm/lyftr?label=Android&logo=android&logoColor=white&color=3ddc84" alt="Android APK" /></a><img src="https://img.shields.io/badge/iOS-planned-black?logo=apple&logoColor=white" alt="iOS planned" /></p>@@ -72,7 +72,7 @@ Open `http://localhost` and create your account.## Try it- **Live demo** — [lyftr-demo.fly.dev](https://lyftr-demo.fly.dev) · `[email protected]` / `password123` (resets hourly)-- **Android** — [download the APK](https://github.com/Cawlumm/lyftr/releases?q=mobile-v), then point it at your server ([mobile docs](https://lyftr-app.pages.dev/mobile/)). iOS is planned.+- **Android** — [download the APK](https://github.com/Cawlumm/lyftr/releases/latest), then point it at your server ([mobile docs](https://lyftr-app.pages.dev/mobile/)). iOS is planned.## Roadmapdiff --git a/RELEASING.md b/RELEASING.mdnew file mode 100644index 0000000..b3d4394--- /dev/null+++ b/RELEASING.md@@ -0,0 +1,72 @@+# Releasing++Backend, web, and mobile ship under one tag now — there's no separate mobile+release train. Releases are cut manually (low cadence, doesn't need automation).++## Tag scheme++`vX.Y.Z` (or `vX.Y.Z-beta.N` while in beta). One tag covers every platform in+that release — don't create a `mobile-v*` tag for a mobile-only change; tag it+`v*` like everything else.++## Cutting a release++```bash+git tag v0.1.0-beta.4+git push origin v0.1.0-beta.4+```++Pushing the tag triggers two workflows:++- **`ci.yml`** — builds and pushes the backend/frontend Docker images tagged+ with this version (`git describe --tags`).+- **`eas-build.yml`** — builds the Android APK on EAS and attaches it to the+ GitHub Release for this tag (takes a while; EAS build + APK download).++Neither workflow deploys the demo off a tag — that already happens on every+push to `main` (see `deploy-demo` in `ci.yml`). Tags exist purely to version+the images and cut the GitHub Release.++## Writing release notes++Once the tag is pushed, write (or edit) the GitHub Release for it:++```bash+gh release create v0.1.0-beta.4 --target main --prerelease --notes-file notes.md+# or, if eas-build.yml's job already created the release (APK build can finish first):+gh release edit v0.1.0-beta.4 --notes-file notes.md+```++Template — no emoji, keep it simple:++```markdown+One-line summary of the release.++## What's new++**Feature name** (#123)+One or two sentences on what it does.++## Fixes & improvements++- Fix or improvement, one line (#124)++## Contributors++@username (#123)+```++Credit goes next to the PR/issue it belongs to, not in a separate paragraph —+include PR authors, reviewers, and whoever originally reported an issue the PR+closes.++The `eas-build.yml` job appends its own "Android (side-load)" download blurb+to whatever body already exists (`append_body: true`), so it's safe to write+the notes before or after the APK finishes building — neither overwrites the+other.++## Historical note++Releases before this change used a separate `mobile-v*` tag namespace for+mobile (`mobile-v0.1.0`, `mobile-v0.2.0`). Those tags and releases are left as+they are — only new releases use the unified `v*` scheme.diff --git a/site/src/content/docs/getting-started.md b/site/src/content/docs/getting-started.mdindex 2c06460..4706022 100644--- a/site/src/content/docs/getting-started.md+++ b/site/src/content/docs/getting-started.md@@ -22,9 +22,9 @@ change anything — or register your own throwaway account.## Get the app- **Android** — download the latest signed APK from the- [Releases](https://github.com/Cawlumm/lyftr/releases?q=mobile-v) page, install it, and point it at+ [Releases](https://github.com/Cawlumm/lyftr/releases/latest) page, install it, and point it atyour server. Side-loaded builds don't auto-update — reinstall over the old one when a new- `mobile-v*` release drops.+ release drops.- **Web** — served by your self-hosted instance (see [Self-Hosting](../self-hosting/)).- **iOS** — planned, shipping via TestFlight / the App Store once the Apple Developer account is set up.diff --git a/site/src/content/docs/mobile.md b/site/src/content/docs/mobile.mdindex 50c26ad..f1d523a 100644--- a/site/src/content/docs/mobile.md+++ b/site/src/content/docs/mobile.md@@ -9,12 +9,12 @@ talking to **your** server.## Android1. Download the latest signed APK from the- [Releases](https://github.com/Cawlumm/lyftr/releases?q=mobile-v) page.+ [Releases](https://github.com/Cawlumm/lyftr/releases/latest) page.2. Open the `.apk` on your phone and allow **"install from unknown sources"** if prompted.3. Launch Lyftr and enter your server URL when asked.:::note[Side-loaded builds don't auto-update]-When a new `mobile-v*` release drops, download and install it over the old one. Store builds with+When a new release drops, download and install it over the old one. Store builds withauto-update are on the roadmap.:::