chore: chain rename + bump to v0.16.0 (mirror URLs, fix auto-update)

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-06-17 17:19:01 +02:00
parent 425d4166af
commit 2d8e9f4048
2 changed files with 30 additions and 32 deletions

View file

@ -2,20 +2,20 @@
#
# Lives here as the canonical source of truth. The bootstrap
# script (scripts/bootstrap-distribution-repos.sh in
# fai/platform) seeds this file into the tap repo at
# fai/chain-private) seeds this file into the tap repo at
# .forgejo/workflows/update.yml. Edit it here, run the
# bootstrap script, the tap repo picks up the new version.
#
# What it does:
# * Every 4 hours, fetches the latest release manifest for
# fai/platform.
# fai/chain-private.
# * If the version differs from the one currently in
# Formula/fai.rb, rewrites the formula's version + sha256
# Formula/chain.rb, rewrites the formula's version + sha256
# entries (macos-aarch64 + macos-x86_64) and commits.
# * Workflow_dispatch trigger lets you force an update from
# the Forgejo UI without waiting for the cron tick.
#
# Manifest contract: fai/platform's release.yml writes
# Manifest contract: fai/chain-private's release.yml writes
# .binaries.{macos-aarch64,macos-x86_64}.sha256 — see
# crates/fai_hub/src/update.rs::ReleaseManifest for the
# authoritative schema.
@ -53,12 +53,12 @@ jobs:
set -eu
# Forgejo's releases API returns newest-first.
REL=$(curl -fsSL \
"https://git.flemming.ai/api/v1/repos/fai/platform/releases?limit=1" \
"https://git.flemming.ai/api/v1/repos/fai/chain-private/releases?limit=1" \
| jq -r '.[0]')
TAG=$(echo "$REL" | jq -r '.tag_name')
VERSION="${TAG#v}"
MANIFEST=$(curl -fsSL \
"https://git.flemming.ai/fai/platform/releases/download/${TAG}/manifest.json")
"https://git.flemming.ai/fai/chain-private/releases/download/${TAG}/manifest.json")
MAC_ARM=$(echo "$MANIFEST" | jq -r '.binaries["macos-aarch64"].sha256 // empty')
MAC_X64=$(echo "$MANIFEST" | jq -r '.binaries["macos-x86_64"].sha256 // empty')
if [ -z "$MAC_ARM" ] || [ -z "$MAC_X64" ]; then
@ -75,11 +75,11 @@ jobs:
id: current
if: steps.manifest.outputs.skip != 'true'
run: |
CUR=$(grep -E '^\s*version\s+"' Formula/fai.rb \
CUR=$(grep -E '^\s*version\s+"' Formula/chain.rb \
| head -1 | sed -E 's/.*"([^"]+)".*/\1/')
echo "version=$CUR" >> "$GITHUB_OUTPUT"
- name: Rewrite Formula/fai.rb
- name: Rewrite Formula/chain.rb
id: rewrite
if: |
steps.manifest.outputs.skip != 'true'
@ -92,7 +92,7 @@ jobs:
set -eu
python3 - <<'PY'
import os, re, pathlib
p = pathlib.Path("Formula/fai.rb")
p = pathlib.Path("Formula/chain.rb")
src = p.read_text()
new_version = os.environ["NEW_VERSION"]
arm_sha = os.environ["NEW_SHA_AARCH64"]
@ -126,8 +126,8 @@ jobs:
NEW_VERSION: ${{ steps.manifest.outputs.version }}
run: |
set -eu
git config user.email "platform@flemming.ai"
git config user.email "chain@flemming.ai"
git config user.name "fai-tap-bot"
git add Formula/fai.rb
git add Formula/chain.rb
git commit -s -m "chore: formula -> v${NEW_VERSION}"
git push origin "HEAD:${GITHUB_REF_NAME}"