Files
magpie/.github/workflows/docker-daily.yml
T
yetone b466aa2803 update: a Daily channel, one release a day that passed its tests, for the app and Docker (fishmagic80 on X)
fishmagic80 on X: Stable is too slow (community plugins need a newer
magpie than it has), every release is too fast, and Docker users have
nothing in between. Daily sits between them.

What it is:
- site/worker.js keepDaily: at the daily cut (20:00 UTC, the quarter-hour
  cron) the newest tag whose commit has a successful Test run and whose
  release has all 17 assets is picked and kept in LEDGER "daily". A day
  with none keeps the day before's; a failed GitHub read writes nothing.
  /api/latest?channel=daily (503 until a pick exists), /download/daily/<p>,
  and an urgent release overlays it as on Stable.
- .github/workflows/docker-daily.yml reads that feed and points
  ghcr.io/yetone/magpie:daily at the picked version's image.
- App: settings.UpdateDaily ("daily"); update.Channel()/Picked() (Stable()
  kept); the feed is asked channel=daily, never falls back to GitHub's
  latest, What's new lists every change since yours. Settings > About >
  Update channel has Every version / Daily / Stable; the version row says
  "Up to date on Daily (· {v} is out on Every version)". CLI: magpie
  update channel [stable|daily|every].
- Words in en, zh, zh-TW, ja, de, on top of 7f832b2f2's 尝鲜版/搶先版/先行版
  for Every version (kept as it landed).
- The channel row wraps its switch under its name when narrow (ja at
  420px was 18px past the window with three segments).
- app.js budget +338: the segment, its line and the two Up to date on
  Daily words, packed to one t() per choice; Settings and renderUpdate
  draw on every window, nothing lazy to move them to.
- Docs: docs/reference.md, site docs (docker, privacy in en/zh/ja),
  llms-full.txt, search indexes.

Red on the old code (a daily-old worktree, then only settings allowing
"daily"): the feed was not asked channel=daily, 40 notes instead of all,
Picked false, notesKey "zh" not "zh|daily", the Daily row showed
"available"; the GUI tests had no Daily segment.

Run on mote at this commit's tree (on origin/main ec1a1a7a5; the Daily pick itself is live on the deployed worker: /api/latest?channel=daily answers 0.1.4171, /download/daily 302s to its dmg):
- go test -count=1 ./internal/settings ./internal/settingsapi
  ./internal/update ./internal/cli ./internal/gui: all ok (TestCoreScriptBudget
  included).
- GUI, chromium and webkit, every language: update-*.test.cjs (22 files),
  i18n-*.test.cjs, settings-search.test.cjs: 554 of 554 pass.
- site: node --test site/*.test.mjs, 132 of 132 (130 before the rebuild).
- gofmt -l clean; go vet darwin, windows (gui/update/cli) and
  GOOS=linux -tags nogui.

Also: site/public/search/*.json and llms-full.txt rebuilt
(search-index.mjs, llms-full.mjs); they still listed Antigravity's old
sign-in after 9cd5f3652, so the two site freshness tests were red.

Filed: #6730, engines.magpie is never read, so a plugin needing a newer
magpie installs on Stable (0.1.3078) and fails without saying why
(page-amp-usage >=0.1.3681, middleware-company-guard >=0.1.3841,
page-day-card >=0.1.3427).

Not tried: a real self-update on Daily, a real docker-daily workflow run,
the whole GUI suite, the worker's unauthenticated GitHub reads under a
rate limit.
2026-11-15 13:10:18 +08:00

72 lines
2.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Docker daily
# ghcr.io/yetone/magpie:daily is the image of the Daily channel's release
# (Settings › Update channel › Daily; fishmagic80 on X, YaoFur's Renovate
# before that): once a day, the newest release out by 20:00 UTC (04:00 in
# China) whose own CI run passed and that has all its files, or an urgent
# one at once. Which release that is, is decided in one place only,
# site/worker.js's keepDaily, and served at /api/latest?channel=daily. This
# only reads that answer and points :daily at the image already built for
# that version (docker.yml); it never builds, and never touches latest,
# stable, edge or a version's tags. While the feed can't be read the tag
# stays where it was. Releases themselves go out as fast as ever.
on:
schedule:
- cron: '53 * * * *'
# a release's image is pushed: an urgent one is Daily at once
workflow_run:
workflows: [Docker]
types: [completed]
workflow_dispatch:
concurrency:
group: docker-daily
cancel-in-progress: false
env:
IMAGE: ghcr.io/${{ github.repository_owner }}/magpie
FEED: https://usemagpie.ai/api/latest?channel=daily
jobs:
daily:
if: github.repository == 'yetone/magpie' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success')
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Point daily at the Daily release's image
run: |
set -euo pipefail
if ! BODY=$(curl -fsS --retry 3 --max-time 30 "$FEED"); then
echo "::warning::the Daily feed couldn't be read; $IMAGE:daily stays where it was"
exit 0
fi
V=$(jq -r '.version // empty' <<<"$BODY")
if [[ ! "$V" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "::warning::the Daily feed named no release ($V); $IMAGE:daily stays where it was"
exit 0
fi
# an image is the platforms' manifests in it, however its index
# is written
digest() { docker buildx imagetools inspect "$1" --format '{{json .}}' | jq -er '[.manifest.manifests[]?.digest] | sort | join(",") | select(. != "")'; }
WANT=$(digest "$IMAGE:$V") # no image for the Daily release is a red run
HAVE=$(digest "$IMAGE:daily" 2>/dev/null || true)
if [[ "$HAVE" == "$WANT" ]]; then
echo "$IMAGE:daily is $V already ($WANT)"
exit 0
fi
docker buildx imagetools create -t "$IMAGE:daily" "$IMAGE:$V"
GOT=$(digest "$IMAGE:daily")
echo "$IMAGE:daily is now $V ($GOT, was ${HAVE:-none})"
test "$GOT" == "$WANT"