From fd8d23ee97f6439f8407c086480ea0a7109f61ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pierzcha=C5=82a?= Date: Sat, 14 Nov 2026 13:35:37 +0100 Subject: [PATCH] ci: prepare the 0.22 source branch for nightly releases --- .github/workflows/ci.yml | 5 ++-- package.json | 2 +- packages/provider-revyl/package.json | 2 +- packages/provider-testmu/package.json | 2 +- packages/provider-tizen/package.json | 2 +- packages/provider-webos/package.json | 2 +- packages/proxy/package.json | 2 +- server.json | 4 +-- src/cli/__tests__/update-check.test.ts | 34 ++++++++++++++++++++++++++ src/cli/update-check.ts | 5 ++-- test/ci/release-workflow.test.ts | 5 ++++ website/docs/docs/installation.md | 6 ++++- 12 files changed, 58 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 809d22b3ed..17ba0ab3e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,13 @@ on: push: branches: - main + - '0.22' permissions: contents: read -# Release and nightly publishing require green CI on the exact main commit, so a -# main push never cancels or replaces another commit's run. +# Release and nightly publishing require green CI on the exact source commit, so a +# push never cancels or replaces another commit's run. concurrency: group: >- ci-${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} diff --git a/package.json b/package.json index ff36b8809e..c053231e5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "agent-device", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "description": "Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.", "mcpName": "io.github.callstack/agent-device", "license": "MIT", diff --git a/packages/provider-revyl/package.json b/packages/provider-revyl/package.json index f00dc546ed..a17e04067a 100644 --- a/packages/provider-revyl/package.json +++ b/packages/provider-revyl/package.json @@ -1,6 +1,6 @@ { "name": "@agent-device/revyl", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "type": "module", "description": "Revyl cloud iOS simulator and Android emulator plugin for agent-device.", "files": [ diff --git a/packages/provider-testmu/package.json b/packages/provider-testmu/package.json index d2e80e65c5..5a9a740597 100644 --- a/packages/provider-testmu/package.json +++ b/packages/provider-testmu/package.json @@ -1,6 +1,6 @@ { "name": "@agent-device/testmu", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "type": "module", "description": "TestMu AI real and virtual mobile device plugin for agent-device.", "files": [ diff --git a/packages/provider-tizen/package.json b/packages/provider-tizen/package.json index 11ac6c0ecd..83691ebebd 100644 --- a/packages/provider-tizen/package.json +++ b/packages/provider-tizen/package.json @@ -1,6 +1,6 @@ { "name": "@agent-device/tizen", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "type": "module", "description": "Samsung Tizen TV web app plugin for agent-device.", "files": [ diff --git a/packages/provider-webos/package.json b/packages/provider-webos/package.json index c64cb7da72..b00eea3445 100644 --- a/packages/provider-webos/package.json +++ b/packages/provider-webos/package.json @@ -1,6 +1,6 @@ { "name": "@agent-device/webos", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "type": "module", "description": "LG webOS TV web app plugin for agent-device.", "files": [ diff --git a/packages/proxy/package.json b/packages/proxy/package.json index b0cfee808e..2652debc04 100644 --- a/packages/proxy/package.json +++ b/packages/proxy/package.json @@ -1,6 +1,6 @@ { "name": "@agent-device/proxy", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "type": "module", "description": "Transport-neutral authenticating proxy in front of an agent-device daemon.", "license": "MIT", diff --git a/server.json b/server.json index dabbfd3e6f..abc83af3db 100644 --- a/server.json +++ b/server.json @@ -7,12 +7,12 @@ "url": "https://github.com/callstack/agent-device", "source": "github" }, - "version": "0.21.38-dev", + "version": "0.22.0-dev", "packages": [ { "registryType": "npm", "identifier": "agent-device", - "version": "0.21.38-dev", + "version": "0.22.0-dev", "transport": { "type": "stdio" }, diff --git a/src/cli/__tests__/update-check.test.ts b/src/cli/__tests__/update-check.test.ts index 03e517e44c..155fc27e30 100644 --- a/src/cli/__tests__/update-check.test.ts +++ b/src/cli/__tests__/update-check.test.ts @@ -252,3 +252,37 @@ test('a failed check after a channel switch records the new channel and drops th assert.equal(cache.latestVersion, undefined); assert.equal(cache.checkedAt, '2026-03-31T10:00:00.000Z'); }); + +test('a 0.22 nightly follows its own dist-tag and ignores cached main-nightly updates', async () => { + const stateDir = makeTempStateDir(); + cleanupPaths.push(stateDir); + const currentVersion = '0.22.0-nightly-0-22.20261113.7'; + writeCache(stateDir, { latestVersion: '0.23.0-nightly.20261114.8', distTag: 'nightly' }); + assert.equal( + withCapturedStderr( + () => maybeRunUpgradeNotifier({ command: 'devices', currentVersion, stateDir, flags: {} }), + { interactive: true }, + ), + '', + ); + const fetchMock = vi.fn().mockResolvedValue({ + ok: true, + json: async () => ({ version: '0.22.0-nightly-0-22.20261114.8' }), + }); + vi.stubGlobal('fetch', fetchMock); + await runUpdateCheckWorker({ + cachePath: path.join(stateDir, 'update-check.json'), + currentVersion, + }); + assert.equal( + fetchMock.mock.calls[0]?.[0], + 'https://registry.npmjs.org/agent-device/nightly-0.22', + ); + assert.match( + withCapturedStderr( + () => maybeRunUpgradeNotifier({ command: 'devices', currentVersion, stateDir, flags: {} }), + { interactive: true }, + ), + /npm install -g agent-device@nightly-0\.22/, + ); +}); diff --git a/src/cli/update-check.ts b/src/cli/update-check.ts index 916d2f84f4..5a82fc535e 100644 --- a/src/cli/update-check.ts +++ b/src/cli/update-check.ts @@ -169,8 +169,9 @@ function cachedDistTag(cache: UpdateCheckCache): string { return cache.distTag ?? 'latest'; } -/** A nightly build follows the `nightly` dist-tag; every other build follows `latest`. */ -function distTagFor(version: string): 'latest' | 'nightly' { +/** Each nightly follows its source channel; other builds follow `latest`. */ +function distTagFor(version: string): 'latest' | 'nightly' | 'nightly-0.22' { + if (version.includes('-nightly-0-22.')) return 'nightly-0.22'; return version.includes('-nightly.') ? 'nightly' : 'latest'; } diff --git a/test/ci/release-workflow.test.ts b/test/ci/release-workflow.test.ts index 7f4fb51541..987eae7083 100644 --- a/test/ci/release-workflow.test.ts +++ b/test/ci/release-workflow.test.ts @@ -52,3 +52,8 @@ test('the published bytes are built without a restored dependency cache', () => ); expect(setup?.with?.['cache-store']).toBe('false'); }); + +test('both fixed nightly source branches receive push CI', () => { + const ci = parse(fs.readFileSync(path.join(repoRoot, '.github/workflows/ci.yml'), 'utf8')); + expect(ci.on.push.branches).toEqual(['main', '0.22']); +}); diff --git a/website/docs/docs/installation.md b/website/docs/docs/installation.md index bd9afb69dc..7840eaabd7 100644 --- a/website/docs/docs/installation.md +++ b/website/docs/docs/installation.md @@ -61,7 +61,11 @@ Nightly builds publish `main` after its CI passes, at most once per UTC day: npm install -g agent-device@nightly ``` -A nightly install's update notice recommends a newer nightly when an update check finds one. To +The `0.22` preview channel requires a separate activation and first successful publish. Once +available, install it with `npm install -g agent-device@nightly-0.22`. If npm reports that the tag +is missing, that channel has not published yet; use `@nightly` for `main` or `@latest` for stable. + +A nightly install's update notice follows the channel you installed, including `nightly-0.22`. To return to stable releases, install `agent-device@latest`. ## Without installing