Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

ci(release-tos): publish channels.json for install version resolution (#5424)

t0sakib2f1f9d2f12c
diff --git a/.github/scripts/generate-channels-json.sh b/.github/scripts/generate-channels-json.sh
new file mode 100755
index 000000000..761162db2
--- /dev/null
+++ b/.github/scripts/generate-channels-json.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# Write channels.json: the version and immutable artifacts each harness
+# installs from under `install.sh --dist tos`. Codex clones the TOS git
+# marketplace; every other harness downloads the marketplace zip and falls back
+# to the source zip.
+
+set -euo pipefail
+
+TAG="${1:?usage: generate-channels-json.sh <tag> <tos-base> <marketplace-zip> <source-zip> <out>}"
+TOS_BASE="${2%/}"
+MARKETPLACE_ZIP="$3"
+SOURCE_ZIP="$4"
+OUT="$5"
+
+sha256() { sha256sum "$1" | cut -d' ' -f1; }
+
+jq -n \
+ --arg version "${TAG#v}" \
+ --arg git_url "${TOS_BASE}/plugins/memory-plugins.git" \
+ --arg bundle_url "${TOS_BASE}/releases/${TAG}/memory-plugin-marketplace.zip" \
+ --arg sha256 "$(sha256 "${MARKETPLACE_ZIP}")" \
+ --arg source_url "${TOS_BASE}/releases/${TAG}/openviking-${TAG}-source.zip" \
+ --arg source_sha256 "$(sha256 "${SOURCE_ZIP}")" \
+ '{version: $version, bundle_url: $bundle_url, sha256: $sha256,
+ source_url: $source_url, source_sha256: $source_sha256} as $archive
+ | {schema: 1, harnesses: (
+ {codex: {version: $version, git_url: $git_url}}
+ + (["claude", "cursor", "trae", "trae-cn", "trae-cli", "zcode", "kimicode",
+ "opencode", "pi", "dsh"] | map({key: ., value: $archive}) | from_entries)
+ )}' > "${OUT}"
diff --git a/.github/workflows/release-tos.yml b/.github/workflows/release-tos.yml
index 32d095b09..f849358b6 100644
--- a/.github/workflows/release-tos.yml
+++ b/.github/workflows/release-tos.yml
@@ -187,6 +187,9 @@ jobs:
upload "${CODEX_INSTALL}" "releases/${RELEASE_TAG}/codex-memory-plugin/install.sh" "${SHELL_CONTENT_TYPE}" "${IMMUTABLE_CACHE_CONTROL}"
upload "${CLAUDE_TOS_INSTALL}" "releases/${RELEASE_TAG}/claude-code-memory-plugin/tos-install.sh" "${SHELL_CONTENT_TYPE}" "${IMMUTABLE_CACHE_CONTROL}"
upload "${CODEX_TOS_INSTALL}" "releases/${RELEASE_TAG}/codex-memory-plugin/tos-install.sh" "${SHELL_CONTENT_TYPE}" "${IMMUTABLE_CACHE_CONTROL}"
+ bash .github/scripts/generate-channels-json.sh "${RELEASE_TAG}" "https://ovrelease.tos-cn-beijing.volces.com" \
+ "${MARKETPLACE_ZIP}" "${SOURCE_ZIP}" /tmp/channels.json
+ upload /tmp/channels.json "releases/${RELEASE_TAG}/channels.json" "application/json" "${IMMUTABLE_CACHE_CONTROL}"
# Stable paths, overwritten on every release. The zips are copied
# server-side from the versioned keys instead of re-transferring them.
@@ -199,6 +202,8 @@ jobs:
upload "${CODEX_INSTALL}" "codex-memory-plugin/install.sh" "${SHELL_CONTENT_TYPE}" "${NO_CACHE_CONTROL}"
upload "${CLAUDE_TOS_INSTALL}" "claude-code-memory-plugin/tos-install.sh" "${SHELL_CONTENT_TYPE}" "${NO_CACHE_CONTROL}"
upload "${CODEX_TOS_INSTALL}" "codex-memory-plugin/tos-install.sh" "${SHELL_CONTENT_TYPE}" "${NO_CACHE_CONTROL}"
+ # Last, so every artifact it points to is already in place.
+ upload "s3://${TOS_BUCKET}/releases/${RELEASE_TAG}/channels.json" "releases/latest/channels.json" "application/json" "${NO_CACHE_CONTROL}"
else
echo "Skipping stable/latest paths (update_latest=false)"
fi