Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# One workflow owns every npm publish, so each package trusts exactly this file
# (npm trusted publishing pins the workflow filename and the npm-publish
# environment). scripts/release-plan.mjs maps the triggering event to a mode:
# dry-run (PR), nightly (schedule or dispatch on main), or stable (a vX.Y.Z tag on
# dry-run (PR), nightly (main-owned schedule or dispatch), or stable (a vX.Y.Z tag on
# main). The tag ruleset, which only admins can bypass, is the stable release's
# approval: a tag publishes without another review.
on:
Expand All @@ -21,15 +21,24 @@
# A nightly ships main's HEAD once its CI passes. CI that fails, is cancelled,
# or outlasts the Plan job's wait skips that day.
- cron: '23 1 * * *'
# The workflow stays on main; the planner resolves 0.22 to its exact source SHA.
- cron: '53 1 * * *'
# On main: publish a nightly now. On a vX.Y.Z tag: retry that stable release.
workflow_dispatch:
inputs:
source_branch:
description: 'Nightly source (run on main; stable tag retries require main)'
type: choice
options: [main, '0.22']
default: main

permissions: {}

concurrency:
group: >-
${{ github.event_name == 'pull_request' && format('release-pr-{0}', github.ref)
|| startsWith(github.ref, 'refs/tags/') && format('release-{0}', github.ref)
|| (github.event.schedule == '53 1 * * *' || inputs.source_branch == '0.22') && 'release-nightly-0.22'
|| 'release-nightly' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Expand All @@ -48,11 +57,13 @@
dist_tag: ${{ steps.plan.outputs.dist_tag }}
commit: ${{ steps.plan.outputs.commit }}
previous_tag: ${{ steps.plan.outputs.previous_tag }}
nightly_tag: ${{ steps.plan.outputs.nightly_tag }}
steps:
- name: Checkout
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
with:
persist-credentials: false
ref: ${{ github.workflow_sha }}

- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
Expand All @@ -73,34 +84,45 @@
timeout-minutes: 120
permissions:
contents: read
cache-mode: none
env:
VERSION: ${{ needs.plan.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ needs.plan.outputs.commit }}

- name: Checkout version stamping entrypoint
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ github.workflow_sha }}
path: .release-tools
sparse-checkout: scripts/release-version.mjs
sparse-checkout-cone-mode: false

# No dependency cache: published bytes come from a clean install.
- name: Setup toolchain
uses: ./.github/actions/setup-node-pnpm
with:
cache-store: 'false'

# Exports AGENT_DEVICE_ANDROID_BUILD_TOOLS, which the helper build requires on CI.
- name: Setup Android SDK

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
schedule
).
Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
workflow_dispatch
).
uses: ./.github/actions/setup-android-sdk

- name: Stamp release version

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
schedule
).
Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
workflow_dispatch
).
run: node scripts/release-version.mjs stamp "$VERSION"
run: node .release-tools/scripts/release-version.mjs stamp "$VERSION"

- name: Build and verify every public package
run: pnpm release:prepare

- name: Upload packages

Check failure

Code scanning / CodeQL

Cache Poisoning via execution of untrusted code High

Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
schedule
).
Potential cache poisoning in the context of the default branch due to privilege checkout of untrusted code from
needs.plan.outputs.commit
. (
workflow_dispatch
).
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: npm-packages
name: npm-packages-${{ needs.plan.outputs.commit }}
path: .tmp/release/*.tgz
include-hidden-files: true
if-no-files-found: error
Expand All @@ -122,6 +144,7 @@
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
with:
persist-credentials: false
ref: ${{ github.workflow_sha }}
sparse-checkout: scripts/release-publish.mjs
sparse-checkout-cone-mode: false

Expand All @@ -135,7 +158,7 @@
- name: Download packages
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: npm-packages
name: npm-packages-${{ needs.plan.outputs.commit }}
path: ${{ runner.temp }}/npm-packages

- name: Publish
Expand All @@ -156,11 +179,12 @@
- name: Tag the published commit
env:
GH_TOKEN: ${{ github.token }}
TAG: nightly/v${{ needs.plan.outputs.version }}
TAG: ${{ needs.plan.outputs.nightly_tag }}
DIST_TAG: ${{ needs.plan.outputs.dist_tag }}
COMMIT: ${{ needs.plan.outputs.commit }}
run: |
gh api "repos/$GITHUB_REPOSITORY/git/refs" -f "ref=refs/tags/$TAG" -f "sha=$COMMIT"
echo "Published $TAG from $COMMIT: npm install agent-device@nightly" >> "$GITHUB_STEP_SUMMARY"
echo "Published $TAG from $COMMIT: npm install agent-device@$DIST_TAG" >> "$GITHUB_STEP_SUMMARY"

github-release:
name: Draft GitHub release
Expand Down
26 changes: 24 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,18 @@ exception is the empty `0.0.0` placeholder a maintainer publishes by hand to onb
described below. A local `npm publish` from the repository root refuses to run.

The core and every public workspace package release together at one version. Private packages
stay unpublished. There are three channels:
stay unpublished. The workflow supports these release modes:

- **Nightly** (`npm install -g agent-device@nightly`): once a day, at 01:23 UTC, the workflow
checks `main`. It publishes `X.Y.Z-nightly.<YYYYMMDD>.<run>` under the `nightly` dist-tag when
`main`'s HEAD has changed since the last nightly and its CI passed, waiting up to 20 minutes for
CI that is still running. If that CI fails, is cancelled, or is still running after the wait, no
nightly ships that day. A published nightly is tagged `nightly/v<nightly version>`. To publish one now, run **Release** on `main`.
- **0.22 nightly** (`nightly-0.22`): at 01:53 UTC, the workflow on `main` resolves `0.22`'s
HEAD, reads its `0.22.X-dev` version, and requires successful push CI on that exact commit.
It builds that SHA as `0.22.X-nightly-0-22.<YYYYMMDD>.<run>` and tags it under
`nightly-0.22/v<version>`. Deduplication and concurrency are separate from `main`'s nightly.
To publish manually after activation, run **Release** on `main` with `source_branch: 0.22`.
- **Stable** (`latest`): a repository admin publishes a GitHub release with a new `vX.Y.Z` tag
targeting `main`. Use the version `main` builds towards (its `X.Y.Z-dev`), or a later one, and
write the notes or generate them in the release form. The tag starts a **Release** run. It waits
Expand Down Expand Up @@ -155,7 +160,8 @@ granting npm trust:
unattended.
2. **Tag ruleset** (Settings → Rules → Rulesets → New tag ruleset): active, targeting
`refs/tags/v*` with no exclusions, restricting creations, updates, and deletions, with only the
Repository admin role allowed to bypass. Nightly tags live under `nightly/` and stay outside it.
Repository admin role allowed to bypass. Nightly tags live under `nightly/` or `nightly-0.22/`
and stay outside it.
3. **Actions** (Settings → Actions → General): workflow permissions set to read repository contents,
and "Allow GitHub Actions to create and approve pull requests" turned off.
4. **Releases** (Settings → General): leave release immutability off, because the run attaches its
Expand Down Expand Up @@ -186,6 +192,22 @@ release. To plan a minor or major release, commit the new `-dev` version to `mai
the repository's tool surface per version string: a released number left on `main` while `main`
keeps changing is indistinguishable from a republished ("rug-pull") version.

### Activate the 0.22 nightly channel

The `nightly-0.22` channel is unavailable until these changes are reviewed and merged and its
first publish succeeds. Merge the `0.22` prerequisite first: enable CI pushes on `0.22`, stamp
`0.22.0-dev` with the existing version script, and include the update notifier's `nightly-0.22`
routing. Require successful push CI at the resulting `0.22` HEAD. Then merge this release
configuration into `main`. Its next 01:53 UTC schedule can publish that source; merging the
configuration activates the schedule. Do not dispatch it before the independent review.

Keep the existing `release.yml` trusted publisher and `npm-publish` policies (`main` and `v*`).
The planner and publisher use the workflow commit; the build uses the planned source commit.
The version-stamping entrypoint uses the workflow commit and calls the source commit's workspace
and MCP metadata helpers. The publisher verifies each package's name and version before publishing.
Do not grant the `0.22` branch deployment access. Private optional plugins remain unpublished;
this channel does not replace their placeholder, trusted-publisher, or native validation prerequisites.

### Released-surface baselines roll forward on publish

Compatibility gates baseline against the last **released tag**, not against `main`, so publishing is
Expand Down
Loading
Loading