Skip to content

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

ci: prepare Vika release workflow for migration (#6755)

weihan0a21641999e6
diff --git a/.github/workflows/api_test.yml b/.github/workflows/api_test.yml
index 39e513404..fe556b75a 100644
--- a/.github/workflows/api_test.yml
+++ b/.github/workflows/api_test.yml
@@ -19,6 +19,7 @@ on:
- '**.svg'
- '.gitignore'
- '.editorconfig'
+ - 'vika/**'
release:
types: [published, prereleased]
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index c3095e83d..e2b36f69a 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -16,6 +16,7 @@ on:
- '**.svg'
- '.gitignore'
- '.editorconfig'
+ - 'vika/**'
jobs:
plugin-tests:
diff --git a/.github/workflows/vika-release.yml b/.github/workflows/vika-release.yml
new file mode 100644
index 000000000..0a2166af2
--- /dev/null
+++ b/.github/workflows/vika-release.yml
@@ -0,0 +1,291 @@
+name: Vika Release
+
+# Tests, builds and publishes Vika (vika/) to the TOS release bucket, laid out
+# the way its installer and updater read it:
+# <prefix>/releases/<version>/ vika-<version>-<platform>.tar.gz (+ .sha256),
+# install.sh, and release.json, uploaded last
+# <prefix>/install.sh, <prefix>/latest written last, only for an
+# [email protected] tag newer than
+# latest and without a "-"
+# A pull request that touches vika/ tests and builds linux-x64 and publishes
+# nothing. A manual run publishes the chosen branch as <version>-<commit>, a
+# preview that `latest` never points to.
+#
+# The tag must not start with v: v*.*.* pushes and releases of v* tags run the
+# main package workflows (docker image, PyPI, TOS release assets).
+
+on:
+ push:
+ tags: ["openviking-vika@*"]
+ workflow_dispatch:
+ inputs:
+ platforms:
+ description: "Platforms to build"
+ type: choice
+ options: [all, linux-x64]
+ default: all
+ pull_request:
+ paths:
+ - "vika/**"
+
+permissions:
+ contents: read
+
+# Only pull request runs replace each other; a publishing run is never cancelled.
+concurrency:
+ group: ${{ github.event_name == 'pull_request' && format('vika-release-{0}', github.ref) || format('vika-release-{0}', github.run_id) }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+env:
+ # Public address of the published tree: release.json and the installer carry
+ # it, and the updater reads <base>/latest from it.
+ VIKA_DOWNLOAD_BASE: ${{ vars.VIKA_DOWNLOAD_BASE || 'https://ovrelease.tos-cn-beijing.volces.com/vika' }}
+ # Key prefix of the same tree in the bucket.
+ VIKA_TOS_PREFIX: ${{ vars.VIKA_TOS_PREFIX || 'vika' }}
+
+jobs:
+ build:
+ name: Test and build
+ runs-on: ubuntu-24.04
+ timeout-minutes: 30
+ defaults:
+ run:
+ working-directory: vika
+ steps:
+ - uses: actions/checkout@v6
+
+ - uses: actions/setup-node@v6
+ with:
+ node-version: "24"
+ cache: npm
+ cache-dependency-path: vika/package-lock.json
+
+ # The meeting ASR worker tests load the worker under Python 3.10+.
+ - uses: actions/setup-python@v6
+ with:
+ python-version: "3.12"
+ - run: python -m pip install -r meeting-asr/requirements.txt
+
+ - name: Validate release tag
+ if: github.event_name == 'push'
+ env:
+ RELEASE_TAG: ${{ github.ref_name }}
+ run: |
+ PACKAGE_VERSION="$(node -p "require('./package.json').version")"
+ test "$RELEASE_TAG" = "openviking-vika@$PACKAGE_VERSION"
+
+ - run: npm ci --no-audit --no-fund
+ - run: npm run check
+ - run: npm test
+
+ - name: Build release archives
+ env:
+ PLATFORMS: ${{ github.event_name == 'pull_request' && 'linux-x64' || inputs.platforms || 'all' }}
+ DIST: ${{ runner.temp }}/vika-dist
+ RELEASE_TAG: ${{ github.event_name == 'push' && github.ref_name || '' }}
+ run: |
+ if [ "$PLATFORMS" = all ]; then set -- --all; else set -- --platform "$PLATFORMS"; fi
+ # A tag names the version; any other run builds <package version>-<commit>.
+ if [ -n "$RELEASE_TAG" ]; then set -- "$@" --version "${RELEASE_TAG#openviking-vika@}"; fi
+ node scripts/build-release.mjs "$@" --download-base "$VIKA_DOWNLOAD_BASE" --out "$DIST"
+ sed "s|__VIKA_DOWNLOAD_BASE__|$VIKA_DOWNLOAD_BASE|" scripts/install.sh > "$DIST/install.sh"
+
+ # What the updater checks before it switches a machine to a release: the
+ # bundled Node starts here and the bundled Pi is the pinned version.
+ - name: Smoke-test the linux-x64 archive
+ env:
+ DIST: ${{ runner.temp }}/vika-dist
+ run: |
+ VERSION="$(jq -r .version "$DIST/release.json")"
+ NAME="vika-$VERSION-linux-x64"
+ (cd "$DIST" && sha256sum -c "$NAME.tar.gz.sha256")
+ mkdir -p "$RUNNER_TEMP/smoke"
+ tar -xzf "$DIST/$NAME.tar.gz" -C "$RUNNER_TEMP/smoke"
+ cd "$RUNNER_TEMP/smoke/$NAME"
+ node/bin/node packages/daemon/scripts/check-pi.mjs
+ node/bin/node packages/cli/bin/vika.mjs --version
+
+ - uses: actions/upload-artifact@v7
+ with:
+ name: vika-dist
+ path: ${{ runner.temp }}/vika-dist
+ retention-days: 7
+ compression-level: 0
+
+ publish:
+ name: Publish to TOS
+ needs: build
+ if: github.event_name != 'pull_request'
+ runs-on: ubuntu-24.04
+ timeout-minutes: 30
+ environment: vika-release
+ permissions:
+ contents: write
+ # Publishing runs one at a time, in order, and none is dropped: two runs of
+ # one version would otherwise both find it unpublished and mix their files.
+ concurrency:
+ group: vika-publish
+ queue: max
+ steps:
+ - uses: actions/download-artifact@v8
+ with:
+ name: vika-dist
+ path: dist
+
+ - uses: actions/setup-python@v6
+ with:
+ python-version: "3.x"
+
+ - name: Install AWS CLI
+ run: |
+ python -m pip install --upgrade awscli
+ aws configure set default.s3.addressing_style virtual
+
+ - name: Upload to TOS
+ env:
+ AWS_ACCESS_KEY_ID: ${{ secrets.TOS_ACCESS_KEY }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.TOS_SECRET_KEY }}
+ AWS_DEFAULT_REGION: ${{ secrets.TOS_REGION }}
+ TOS_BUCKET: ${{ secrets.TOS_RELEASE_BUCKET }}
+ TOS_ENDPOINT: ${{ secrets.TOS_ENDPOINT }}
+ IS_RELEASE: ${{ github.event_name == 'push' }}
+ run: |
+ set -euo pipefail
+ for name in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION TOS_BUCKET TOS_ENDPOINT; do
+ if [ -z "${!name}" ]; then
+ echo "::error::TOS is not configured: ${name} is empty"
+ exit 1
+ fi
+ done
+ TOS_ENDPOINT="${TOS_ENDPOINT#https://}"
+ TOS_ENDPOINT="${TOS_ENDPOINT#http://}"
+ case "${TOS_ENDPOINT}" in
+ tos-s3-*) TOS_S3_ENDPOINT="${TOS_ENDPOINT}" ;;
+ tos-*) TOS_S3_ENDPOINT="tos-s3-${TOS_ENDPOINT#tos-}" ;;
+ *) TOS_S3_ENDPOINT="${TOS_ENDPOINT}" ;;
+ esac
+ IMMUTABLE="public, max-age=31536000, immutable"
+ NO_CACHE="no-store, no-cache, must-revalidate, max-age=0"
+ TEXT="text/plain; charset=utf-8"
+
+ upload() {
+ disposition=()
+ case "$3" in text/*) disposition=(--content-disposition inline) ;; esac
+ aws s3 cp "$1" "s3://${TOS_BUCKET}/$2" \
+ --endpoint-url "https://${TOS_S3_ENDPOINT}" \
+ --content-type "$3" \
+ --cache-control "$4" \
+ ${disposition[@]+"${disposition[@]}"} \
+ --only-show-errors
+ echo "Uploaded $2"
+ }
+
+ # fetch <key> <file> succeeds when it downloads the key and fails when
+ # the key does not exist. Any other error stops the run, so a failed
+ # read never passes for a missing object.
+ fetch() {
+ local output
+ if output="$(aws s3 cp "s3://${TOS_BUCKET}/$1" "$2" \
+ --endpoint-url "https://${TOS_S3_ENDPOINT}" --only-show-errors 2>&1)"; then
+ return 0
+ fi
+ if grep -q '(404)' <<<"${output}"; then
+ return 1
+ fi
+ echo "::error::Cannot read $1: ${output}"
+ exit 1
+ }
+
+ VERSION="$(jq -r .version dist/release.json)"
+ DIR="${VIKA_TOS_PREFIX}/releases/${VERSION}"
+ # A version is published once, and its release.json goes up last.
+ # Finding this run's own release.json means the job is re-run after a
+ # later step failed: the files are in place and the rest goes on. Any
+ # other release.json belongs to a different build of the version.
+ UPLOADED=false
+ if fetch "${DIR}/release.json" published-release.json; then
+ if ! cmp -s published-release.json dist/release.json; then
+ echo "::error::Vika ${VERSION} is published already"
+ exit 1
+ fi
+ UPLOADED=true
+ echo "Vika ${VERSION} is uploaded already; finishing its release"
+ fi
+
+ # `latest` only moves forward and never to a pre-release (a version
+ # with a "-"): a hotfix on an older line or a release candidate gets
+ # its own directory and leaves every installed Vika where it is.
+ # Writing the version `latest` holds already is a re-run's no-op.
+ MOVE_LATEST=false
+ CURRENT=""
+ if [ "${IS_RELEASE}" = true ]; then
+ if fetch "${VIKA_TOS_PREFIX}/latest" current-latest; then
+ CURRENT="$(tr -d ' \r\n' < current-latest)"
+ fi
+ case "${VERSION}" in
+ *-*) ;;
+ *)
+ NEWEST="$(printf '%s\n%s\n' "${CURRENT}" "${VERSION}" | sort -V | tail -n 1)"
+ if [ "${NEWEST}" = "${VERSION}" ]; then
+ MOVE_LATEST=true
+ fi
+ ;;
+ esac
+ fi
+
+ if [ "${UPLOADED}" = false ]; then
+ for archive in dist/*.tar.gz; do
+ upload "${archive}" "${DIR}/$(basename "${archive}")" application/gzip "${IMMUTABLE}"
+ upload "${archive}.sha256" "${DIR}/$(basename "${archive}").sha256" "${TEXT}" "${IMMUTABLE}"
+ done
+ upload dist/install.sh "${DIR}/install.sh" "${TEXT}" "${IMMUTABLE}"
+ upload dist/release.json "${DIR}/release.json" application/json "${IMMUTABLE}"
+ fi
+ if [ "${MOVE_LATEST}" = true ]; then
+ printf '%s\n' "${VERSION}" > latest
+ upload dist/install.sh "${VIKA_TOS_PREFIX}/install.sh" "${TEXT}" "${NO_CACHE}"
+ upload latest "${VIKA_TOS_PREFIX}/latest" "${TEXT}" "${NO_CACHE}"
+ fi
+
+ {
+ echo "## Vika ${VERSION}"
+ if [ "${MOVE_LATEST}" = true ]; then
+ echo '```sh'
+ echo "curl -fsSL ${VIKA_DOWNLOAD_BASE}/install.sh | sh"
+ echo '```'
+ else
+ if [ "${IS_RELEASE}" = true ]; then
+ echo "\`latest\` stays at ${CURRENT}: ${VERSION} is a pre-release or older. Install it with"
+ else
+ echo "Preview: \`latest\` is unchanged. Install it with"
+ fi
+ echo '```sh'
+ echo "curl -fsSL ${VIKA_DOWNLOAD_BASE}/releases/${VERSION}/install.sh | sh -s -- --version ${VERSION}"
+ echo '```'
+ echo "then \`vika restart\` on a machine that already runs Vika; \`vika upgrade all\` returns it to the latest release."
+ fi
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ # Not marked as the repository's latest release, which stays OpenViking's.
+ # A re-run completes the assets of a release an earlier attempt created.
+ - name: Create GitHub Release
+ if: github.event_name == 'push'
+ env:
+ GH_TOKEN: ${{ github.token }}
+ TAG: ${{ github.ref_name }}
+ run: |
+ if gh release view "${TAG}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
+ gh release upload "${TAG}" dist/*.tar.gz dist/*.sha256 dist/release.json \
+ --repo "${GITHUB_REPOSITORY}" --clobber
+ exit 0
+ fi
+ VERSION="$(jq -r .version dist/release.json)"
+ PRERELEASE=()
+ case "${VERSION}" in *-*) PRERELEASE=(--prerelease) ;; esac
+ gh release create "${TAG}" dist/*.tar.gz dist/*.sha256 dist/release.json \
+ --repo "${GITHUB_REPOSITORY}" \
+ --verify-tag \
+ --latest=false \
+ ${PRERELEASE[@]+"${PRERELEASE[@]}"} \
+ --title "Vika ${VERSION}" \
+ --notes "Install this version: \`curl -fsSL ${VIKA_DOWNLOAD_BASE}/releases/${VERSION}/install.sh | sh -s -- --version ${VERSION}\`"
diff --git a/docs/repository/RELEASE.md b/docs/repository/RELEASE.md
index e98014837..5d238d015 100644
--- a/docs/repository/RELEASE.md
+++ b/docs/repository/RELEASE.md
@@ -31,6 +31,7 @@ Use the following tag conventions:
| `openviking-ms-agent-framework` | `[email protected]` | Must match the version in `integrations/frameworks/microsoft-agent-framework/pyproject.toml`. |
| `@openviking/sdk` (TypeScript) | `[email protected]` | TypeScript SDK tag. |
| Rust CLI / npm CLI | `[email protected]` | CLI-only tag, for example `[email protected]`. |
+| Vika (`vika/`) | `[email protected]` | Must match the version in `vika/package.json`. See [Vika Release Flow](#vika-release-flow). |
| ClawHub plugin latest | `YYYY.M.D` or `YYYY.M.D-N` | Generated by the workflow or specified manually. |
| ClawHub plugin dev | `YYYY.M.D-dev.N` | Used for the dev channel. |
@@ -162,6 +163,21 @@ After a `cli@*` tag is pushed, the `Rust CLI Build` workflow builds the `ov` bin
The workflow injects the version from the tag into the platform packages and wrapper package. If the same version already exists on npm, the workflow skips the already published package.
+## Vika Release Flow
+
+Vika (`vika/`) ships as one self-contained archive per platform: linux-x64, linux-arm64, darwin-x64 and darwin-arm64, each with its own Node and dependencies. The `Vika Release` workflow (`vika-release.yml`) tests, builds and uploads them to the TOS release bucket under `vika/`:
+
+- `vika/releases/<version>/`: the archives with their `.sha256` files, `install.sh`, and `release.json`, which is uploaded last. A version is published once: a run stops when a different build of it is uploaded already, while re-running a failed publish job finishes the same build. Publish jobs run one at a time.
+- `vika/install.sh` and `vika/latest`: written last, and only by a formal release newer than the current `vika/latest`. Users install with `curl -fsSL https://ovrelease.tos-cn-beijing.volces.com/vika/install.sh | sh`, and `vika upgrade` follows `vika/latest`. A tag with an older version, such as a hotfix on an earlier line, or with a `-` in it, such as `[email protected]`, publishes only its own directory; a `-` version's GitHub Release is marked as a pre-release.
+
+Formal release: set the version in `vika/package.json`, merge, then push the matching `[email protected]` tag. The tag must not start with `v`: `v*.*.*` tag pushes and Releases of `v*` tags run the main package workflows. The workflow also creates a GitHub Release for the tag that is not marked as the repository's latest release.
+
+Preview of a branch: run the workflow on that branch, from the Actions page or with `gh workflow run vika-release.yml --ref <branch>`. It publishes `<package version>-<commit>` without moving `vika/latest`, and the run summary shows the install command. Only branches in this repository can be previewed, because publishing needs the TOS secrets.
+
+Pull requests that touch `vika/` run the tests and build and check the linux-x64 archive without publishing.
+
+The workflow uses the same TOS secrets as `release-tos.yml`. The `VIKA_DOWNLOAD_BASE` and `VIKA_TOS_PREFIX` repository variables override the public address and the key prefix, for example to rehearse in a fork against a test bucket.
+
## OpenClaw / ClawHub Plugin Release
The OpenClaw plugin is published manually through the `OpenViking OpenClaw plugin release` workflow. Inputs include:
diff --git a/docs/repository/RELEASE_CN.md b/docs/repository/RELEASE_CN.md
index 2a9a305d4..b4d6971e7 100644
--- a/docs/repository/RELEASE_CN.md
+++ b/docs/repository/RELEASE_CN.md
@@ -27,6 +27,7 @@ OpenViking 的发版目标不是单一产物,而是围绕不同使用入口发
| `openviking-sdk` | `[email protected]` | SDK 专用 tag,例如 `[email protected]`。 |
| `openviking-ms-agent-framework` | `[email protected]` | 必须与 `integrations/frameworks/microsoft-agent-framework/pyproject.toml` 中的版本一致。 |
| Rust CLI / npm CLI | `[email protected]` | CLI 专用 tag,例如 `[email protected]`。 |
+| Vika(`vika/`) | `[email protected]` | 必须与 `vika/package.json` 中的版本一致,见 [Vika 发版流程](#vika-发版流程)。 |
| ClawHub 插件 latest | `YYYY.M.D` 或 `YYYY.M.D-N` | 由 workflow 自动生成或手动指定。 |
| ClawHub 插件 dev | `YYYY.M.D-dev.N` | dev channel 使用。 |
@@ -158,6 +159,21 @@ [email protected]
workflow 会把 tag 中的版本写入平台包和 wrapper 包。如果 npm 上已存在同版本包,workflow 会跳过已发布版本。
+## Vika 发版流程
+
+Vika(`vika/`)按平台发布自包含的安装包:linux-x64、linux-arm64、darwin-x64、darwin-arm64,每个都自带 Node 和依赖。`Vika Release` workflow(`vika-release.yml`)负责测试、构建并上传到 TOS 发布桶的 `vika/` 下:
+
+- `vika/releases/<版本>/`:安装包及其 `.sha256`、`install.sh`,以及最后上传的 `release.json`。每个版本只发布一次:同一版本的另一份构建已经上传时,workflow 直接停止;重跑失败的发布 job 会把同一份构建发布完。发布 job 依次执行,不会并行。
+- `vika/install.sh` 和 `vika/latest`:最后写入,只有比当前 `vika/latest` 更新的正式版才会更新。用户用 `curl -fsSL https://ovrelease.tos-cn-beijing.volces.com/vika/install.sh | sh` 安装,`vika upgrade` 按 `vika/latest` 升级。版本更旧的 tag(例如旧版本线上的热修复)或带 `-` 的 tag(例如 `[email protected]`)只发布自己的版本目录;带 `-` 的版本在 GitHub 上标记为预发布。
+
+正式发版:在 `vika/package.json` 中设定版本并合入,然后推送与之一致的 `[email protected]` tag。tag 不能以 `v` 开头:推送 `v*.*.*` tag、为 `v*` tag 发布 Release 都会触发主包的 workflow。workflow 同时为该 tag 创建 GitHub Release,不会将其标记为仓库的最新 Release。
+
+分支预览:在该分支上运行 workflow,可以在 Actions 页面操作,也可以执行 `gh workflow run vika-release.yml --ref <分支>`。它发布 `<package 版本>-<commit>`,不改动 `vika/latest`,运行摘要里给出安装命令。发布需要 TOS secrets,所以只能预览本仓库内的分支。
+
+改动 `vika/` 的 PR 会跑测试,并构建、检查 linux-x64 安装包,但不发布。
+
+workflow 使用与 `release-tos.yml` 相同的 TOS secrets。仓库变量 `VIKA_DOWNLOAD_BASE` 和 `VIKA_TOS_PREFIX` 可以覆盖公开地址和 key 前缀,例如在 fork 中对着测试桶演练。
+
## OpenClaw / ClawHub 插件发布
OpenClaw 插件通过 `ClawHub release (OpenViking plugin)` workflow 手动发布。输入参数包括: