Skip to content

Commit aa08acc

Browse files
author
Ronald Tse
committed
ci: publish models index via GitHub Releases (index-v* tags)
Runtimes must pin DEFAULT_INDEX_URL to a Release asset + sha256 sidecar — never raw.githubusercontent.com, never main. Workflow release-index.yml stages models-index.yaml and its .sha256 on every index-v* tag (or workflow_dispatch).
1 parent 2f4f9e4 commit aa08acc

2 files changed

Lines changed: 80 additions & 10 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: release-index
2+
3+
# Publishes models.yaml as a GitHub Release asset (models-index.yaml +
4+
# .sha256 sidecar). Runtimes pin DEFAULT_INDEX_URL to a specific index-v*
5+
# tag — never raw.githubusercontent.com, never main.
6+
#
7+
# Trigger: push of an index-v* tag, or workflow_dispatch with a tag name.
8+
on:
9+
push:
10+
tags:
11+
- "index-v*"
12+
workflow_dispatch:
13+
inputs:
14+
tag:
15+
description: "Release tag (e.g. index-v1). Created if missing."
16+
required: true
17+
type: string
18+
19+
permissions:
20+
contents: write
21+
22+
jobs:
23+
release:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v7
27+
28+
- name: Stage index assets
29+
run: |
30+
test -f models.yaml
31+
cp models.yaml models-index.yaml
32+
shasum -a 256 models-index.yaml | awk '{print $1 " models-index.yaml"}' > models-index.yaml.sha256
33+
echo "--- models-index.yaml.sha256 ---"
34+
cat models-index.yaml.sha256
35+
echo "--- head models-index.yaml ---"
36+
head -20 models-index.yaml
37+
38+
- name: Create or update GitHub Release
39+
env:
40+
GH_TOKEN: ${{ github.token }}
41+
run: |
42+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
43+
tag="${{ inputs.tag }}"
44+
else
45+
tag="${GITHUB_REF_NAME}"
46+
fi
47+
case "$tag" in
48+
index-v*) ;;
49+
*) echo "tag must match index-v*: got '$tag'" >&2; exit 1 ;;
50+
esac
51+
if ! gh release view "$tag" >/dev/null 2>&1; then
52+
gh release create "$tag" \
53+
--title "$tag" \
54+
--notes "Interscript ML model index ($tag). Runtimes resolve DEFAULT_INDEX_URL against this release asset + sha256 sidecar." \
55+
--target "$GITHUB_SHA"
56+
fi
57+
gh release upload "$tag" models-index.yaml models-index.yaml.sha256 --clobber
58+
echo "published $tag"
59+
gh release view "$tag" --json assets --jq '.assets[].name'

‎models.yaml‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,31 @@
1-
# interscript-ml model index — the stable URL every runtime resolves
2-
# model ids against (Ruby / TypeScript / Python implement the same
3-
# algorithm; this file is the contract).
1+
# interscript-ml model index — the contract every runtime resolves model
2+
# ids against (Ruby / TypeScript / Python implement the same algorithm).
3+
#
4+
# DISTRIBUTION: this file is published as a GitHub Release asset, never
5+
# via raw.githubusercontent.com. Tag shape: index-vN. Assets per release:
6+
# models-index.yaml
7+
# models-index.yaml.sha256
8+
# URL shape runtimes pin:
9+
# https://github.com/interscript/interscript-ml/releases/download/index-vN/models-index.yaml
10+
# Cut a new index-vN tag (or dispatch release-index.yml) whenever the
11+
# index content changes in a way production consumers must see.
412
#
513
# Resolution algorithm (identical in all runtimes):
6-
# 1. resolve `id` in models.models
7-
# 2. prefer an installed cache copy at <cache_dir>/<id>/<filename>
14+
# 1. fetch the pinned index URL + its .sha256 sidecar; verify the body
15+
# 2. resolve `id` in models.models
16+
# 3. prefer an installed cache copy at <cache_dir>/<id>/<filename>
817
# whose whole-file sha256 matches `sha256`
9-
# 3. else download `url` to a temp file in the same directory,
18+
# 4. else download `url` (or assemble `parts`) to a temp file,
1019
# verify sha256, atomically rename into place
11-
# 4. load the zip (IMF v1: member sha256 verification on load)
20+
# 5. load the zip (IMF v1: member sha256 verification on load)
1221
#
13-
# Overrides: SECRYST_INDEX (URL or path to an index like this one),
14-
# SECRYST_CACHE (cache directory; default ~/.cache/secryst).
22+
# Overrides: SECRYST_INDEX (URL or path to an index like this one —
23+
# HTTP sources must ship a sibling .sha256), SECRYST_CACHE (cache
24+
# directory; default ~/.cache/secryst or ~/.cache/interscript).
1525
#
1626
# Adding a model: it must have passed the WO03 gate (strict validation,
17-
# parity written into the zip) before an entry ships here.
27+
# parity written into the zip) before an entry ships here. Then cut a
28+
# new index-vN so runtimes pick it up on their next pin bump.
1829
version: 1
1930
models:
2031
khm-latn-1.0:

0 commit comments

Comments
 (0)