Skip to content
This repository was archived by the owner on Oct 5, 2026. It is now read-only.

Update Claude SDK and release #3

Update Claude SDK and release

Update Claude SDK and release #3

name: Update Claude SDK and release
on:
schedule:
- cron: '23 6 * * *'
workflow_dispatch:
# Serialize the commit/tag with manual releases. Never interrupt a release.
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: read
jobs:
update:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 45
permissions:
contents: write
outputs:
changed: ${{ steps.update.outputs.changed }}
tag: ${{ steps.release.outputs.tag }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
- name: Update the pinned SDK and lockfile
id: update
run: node scripts/update-claude-sdk.mjs
- name: Test helpers and the patched Claude adapter
if: steps.update.outputs.changed == 'true'
run: |
npm test
npm ci --ignore-scripts --prefix image/claude-agent-acp
node image/claude-agent-acp/patch-adapter.mjs image/claude-agent-acp/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
node --check image/claude-agent-acp/node_modules/@agentclientprotocol/claude-agent-acp/dist/acp-agent.js
node --test test/claude-turn-completion-smoke.mjs test/claude-session-state-smoke.mjs test/claude-session-home-smoke.mjs
- name: Set up Buildx
if: steps.update.outputs.changed == 'true'
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Build candidate image
if: steps.update.outputs.changed == 'true'
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: image
file: image/Dockerfile
load: true
tags: nuphos-runtime:sdk-candidate
build-args: |
BASE_IMAGE=ghcr.io/zeabur/nuphos-runtime:0.0.12-base-codex
RUNTIME_PROVIDER=claude-code
cache-from: type=gha,scope=runtime-claude-code
cache-to: type=gha,mode=max,scope=runtime-claude-code
- name: Smoke-test image and native model discovery without prompts
if: steps.update.outputs.changed == 'true'
run: |
docker run --rm -v "$PWD/test:/smoke:ro" --entrypoint bash nuphos-runtime:sdk-candidate /smoke/image-smoke.sh
docker run --rm -v "$PWD/test:/smoke:ro" --entrypoint node nuphos-runtime:sdk-candidate /smoke/model-discovery.mjs claude-code > /tmp/models.json
jq -e '.models | length > 0' /tmp/models.json
cat /tmp/models.json >> "$GITHUB_STEP_SUMMARY"
- name: Commit tested SDK and tag a runtime patch
id: release
if: steps.update.outputs.changed == 'true'
env:
GH_TOKEN: ${{ github.token }}
SDK: ${{ steps.update.outputs.sdk }}
run: |
set -euo pipefail
VERSION=$(node -e 'const fs=require("fs");const p=JSON.parse(fs.readFileSync("package.json"));if(!/^\d+\.\d+\.\d+$/.test(p.version))throw Error("Invalid runtime version");const v=p.version.split(".").map(Number);v[2]++;p.version=v.join(".");fs.writeFileSync("package.json",JSON.stringify(p,null,2)+"\n");console.log(p.version)')
if git rev-parse --verify --quiet "refs/tags/v${VERSION}"; then
echo '::error::Runtime tag already exists'
exit 1
fi
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add image/claude-agent-acp/package.json image/claude-agent-acp/package-lock.json image/Dockerfile README.md package.json
git commit -m "fix(runtime): update Claude SDK to ${SDK} (v${VERSION})"
git tag "v${VERSION}"
gh auth setup-git
# Reject a concurrent main change; never rebase untested code or bypass branch rules.
git push --atomic origin HEAD:main "refs/tags/v${VERSION}"
echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
publish:
needs: update
if: needs.update.outputs.changed == 'true'
uses: ./.github/workflows/build.yml
permissions:
contents: write
packages: write
with:
release_tag: ${{ needs.update.outputs.tag }}
provider: both
reuse_base: false