Skip to content

Commit f359871

Browse files
committed
ci: publish darwin sidecar and plugin artifacts
1 parent f32d1c3 commit f359871

12 files changed

Lines changed: 168 additions & 20 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ concurrency:
4040
env:
4141
R2_BUCKET: rivet-releases
4242
R2_ENDPOINT: https://2a94c6a0ced8d35ea63cddc86c2681e7.r2.cloudflarestorage.com
43-
# Platform list kept in sync with packages/*sidecar*/npm/* and the build
44-
# matrix below. Also consumed by scripts/publish discovery via SIDECAR_PLATFORMS.
45-
# arm64 is deferred until its portability fix is verified end-to-end.
46-
SIDECAR_PLATFORMS: "linux-x64-gnu"
43+
# Platform list kept in sync with packages/*sidecar*/npm/*,
44+
# packages/agentos-plugin/npm/*, and the build matrices below. Also consumed
45+
# by scripts/publish discovery via SIDECAR_PLATFORMS.
46+
# Linux arm64 is deferred until its portability fix is verified end-to-end.
47+
SIDECAR_PLATFORMS: "linux-x64-gnu darwin-arm64 darwin-x64"
4748

4849
jobs:
4950
# ---------------------------------------------------------------------------
@@ -87,6 +88,12 @@ jobs:
8788
- platform: linux-x64-gnu
8889
runner: ubuntu-22.04
8990
target: x86_64-unknown-linux-gnu
91+
- platform: darwin-arm64
92+
runner: macos-14
93+
target: aarch64-apple-darwin
94+
- platform: darwin-x64
95+
runner: macos-13
96+
target: x86_64-apple-darwin
9097
runs-on: ${{ matrix.runner }}
9198
steps:
9299
- uses: actions/checkout@v4
@@ -154,6 +161,15 @@ jobs:
154161
- platform: linux-x64-gnu
155162
runner: ubuntu-22.04
156163
target: x86_64-unknown-linux-gnu
164+
lib_name: libagentos_actor_plugin.so
165+
- platform: darwin-arm64
166+
runner: macos-14
167+
target: aarch64-apple-darwin
168+
lib_name: libagentos_actor_plugin.dylib
169+
- platform: darwin-x64
170+
runner: macos-13
171+
target: x86_64-apple-darwin
172+
lib_name: libagentos_actor_plugin.dylib
157173
runs-on: ${{ matrix.runner }}
158174
steps:
159175
- uses: actions/checkout@v4
@@ -192,8 +208,8 @@ jobs:
192208
cargo build -p agentos-actor-plugin --target ${{ matrix.target }}
193209
profile="debug"
194210
fi
195-
cp "target/${{ matrix.target }}/${profile}/libagentos_actor_plugin.so" \
196-
"$out/libagentos_actor_plugin.so"
211+
cp "target/${{ matrix.target }}/${profile}/${{ matrix.lib_name }}" \
212+
"$out/${{ matrix.lib_name }}"
197213
echo "dir=$out" >> "$GITHUB_OUTPUT"
198214
- uses: actions/upload-artifact@v4
199215
with:
@@ -249,7 +265,11 @@ jobs:
249265
run: |
250266
set -euo pipefail
251267
for p in $SIDECAR_PLATFORMS; do
252-
lib="artifacts/plugin-${p}/libagentos_actor_plugin.so"
268+
case "$p" in
269+
darwin-*) lib_name="libagentos_actor_plugin.dylib" ;;
270+
*) lib_name="libagentos_actor_plugin.so" ;;
271+
esac
272+
lib="artifacts/plugin-${p}/${lib_name}"
253273
dest="packages/agentos-plugin/npm/${p}"
254274
if [ ! -f "$lib" ]; then
255275
echo "::error::missing plugin cdylib artifact for ${p}"
@@ -259,7 +279,7 @@ jobs:
259279
echo "::error::missing plugin platform package dir $dest"
260280
exit 1
261281
fi
262-
cp "$lib" "${dest}/libagentos_actor_plugin.so"
282+
cp "$lib" "${dest}/${lib_name}"
263283
echo "Placed plugin cdylib for ${p}"
264284
done
265285
- name: Bump package versions for build (version-only)
@@ -320,6 +340,8 @@ jobs:
320340
declare -A PLATFORM_TARGET=(
321341
[linux-x64-gnu]=x86_64-unknown-linux-gnu
322342
[linux-arm64-gnu]=aarch64-unknown-linux-gnu
343+
[darwin-arm64]=aarch64-apple-darwin
344+
[darwin-x64]=x86_64-apple-darwin
323345
)
324346
# Stage release assets: platform binaries + externalized pyodide assets
325347
# (downloaded by the published execution crate's build.rs).

packages/agentos-plugin/npm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ The binary is built in CI (`.github/workflows/publish.yaml`, `build-plugin`
1414
job: `cargo build -p agentos-actor-plugin`) and copied into the matching
1515
platform directory before publish. The committed directories contain only the
1616
`package.json` describing the platform.
17+
18+
Supported platforms: `linux-x64-gnu`, `darwin-arm64`, `darwin-x64`.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@rivet-dev/agentos-plugin-darwin-arm64",
3+
"version": "0.2.0-rc.3",
4+
"description": "Agent OS actor plugin cdylib for macOS arm64",
5+
"license": "Apache-2.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/rivet-dev/agent-os.git",
9+
"directory": "packages/agentos-plugin/npm/darwin-arm64"
10+
},
11+
"os": [
12+
"darwin"
13+
],
14+
"cpu": [
15+
"arm64"
16+
],
17+
"files": [
18+
"libagentos_actor_plugin.dylib"
19+
],
20+
"engines": {
21+
"node": ">=20"
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@rivet-dev/agentos-plugin-darwin-x64",
3+
"version": "0.2.0-rc.3",
4+
"description": "Agent OS actor plugin cdylib for macOS x64",
5+
"license": "Apache-2.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/rivet-dev/agent-os.git",
9+
"directory": "packages/agentos-plugin/npm/darwin-x64"
10+
},
11+
"os": [
12+
"darwin"
13+
],
14+
"cpu": [
15+
"x64"
16+
],
17+
"files": [
18+
"libagentos_actor_plugin.dylib"
19+
],
20+
"engines": {
21+
"node": ">=20"
22+
}
23+
}

packages/agentos/src/plugin-binary.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ function getPlatformPackageName(): string | null {
3636
if (arch === "x64") return "@rivet-dev/agentos-plugin-linux-x64-gnu";
3737
if (arch === "arm64") return "@rivet-dev/agentos-plugin-linux-arm64-gnu";
3838
break;
39+
case "darwin":
40+
if (arch === "arm64") return "@rivet-dev/agentos-plugin-darwin-arm64";
41+
if (arch === "x64") return "@rivet-dev/agentos-plugin-darwin-x64";
42+
break;
3943
default:
4044
break;
4145
}
@@ -74,7 +78,7 @@ export function getPluginPath(): string {
7478
if (!platformPkg) {
7579
throw new Error(
7680
`@rivet-dev/agentos: unsupported platform ${process.platform}/${process.arch}. ` +
77-
"The Agent OS actor plugin currently supports linux x64 and arm64. " +
81+
"The Agent OS actor plugin currently supports linux x64/arm64 and macOS x64/arm64. " +
7882
`Set ${PLUGIN_BIN_ENV} to a local cdylib to override.`,
7983
);
8084
}

packages/sidecar-binary/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# @rivet-dev/agent-os-sidecar
1+
# @rivet-dev/agentos-sidecar
22

33
Platform-specific resolver for the Agent OS native sidecar binary.
44

5-
The compiled `agent-os-sidecar` binary ships inside one of the
6-
`@rivet-dev/agent-os-sidecar-<platform>` packages, which this package declares as
5+
The compiled `agentos-sidecar` binary ships inside one of the
6+
`@rivet-dev/agentos-sidecar-<platform>` packages, which this package declares as
77
optional dependencies. npm installs only the package matching the current
88
`os`/`cpu`/`libc` at install time.
99

1010
```js
11-
const { getSidecarPath } = require("@rivet-dev/agent-os-sidecar");
11+
const { getSidecarPath } = require("@rivet-dev/agentos-sidecar");
1212

1313
const binaryPath = getSidecarPath();
1414
```
1515

16-
Set `AGENT_OS_SIDECAR_BIN` to an absolute path to override resolution (useful
16+
Set `AGENTOS_SIDECAR_BIN` to an absolute path to override resolution (useful
1717
for development or custom builds).
1818

19-
Supported platforms: `linux-x64-gnu`, `linux-arm64-gnu`.
19+
Supported platforms: `linux-x64-gnu`, `darwin-arm64`, `darwin-x64`.

packages/sidecar-binary/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ function getPlatformPackageName() {
2727
if (arch === "x64") return "@rivet-dev/agentos-sidecar-linux-x64-gnu";
2828
if (arch === "arm64") return "@rivet-dev/agentos-sidecar-linux-arm64-gnu";
2929
break;
30+
case "darwin":
31+
if (arch === "arm64") return "@rivet-dev/agentos-sidecar-darwin-arm64";
32+
if (arch === "x64") return "@rivet-dev/agentos-sidecar-darwin-x64";
33+
break;
3034
default:
3135
break;
3236
}
@@ -53,7 +57,7 @@ function getSidecarPath() {
5357
if (!platformPkg) {
5458
throw new Error(
5559
`@rivet-dev/agentos-sidecar: unsupported platform ${process.platform}/${process.arch}. ` +
56-
"The Agent OS sidecar currently supports linux x64 and arm64. " +
60+
"The Agent OS sidecar currently supports linux x64/arm64 and macOS x64/arm64. " +
5761
"Set AGENTOS_SIDECAR_BIN to a local agentos-sidecar binary to override.",
5862
);
5963
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Agent OS sidecar platform packages
22

33
Each subdirectory is a platform-specific npm package that ships the compiled
4-
`agent-os-sidecar` binary for one target. They are published by the release
4+
`agentos-sidecar` binary for one target. They are published by the release
55
workflow, which builds the binary for each platform and copies it into the
66
matching directory before `npm publish`. They are not pnpm workspace members and
77
are not built by Turborepo.
88

9-
The meta package `@rivet-dev/agent-os-sidecar` (one directory up) resolves the
9+
The meta package `@rivet-dev/agentos-sidecar` (one directory up) resolves the
1010
correct platform package at runtime via npm `os`/`cpu`/`libc` selection.
11+
12+
Supported platforms: `linux-x64-gnu`, `darwin-arm64`, `darwin-x64`.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@rivet-dev/agentos-sidecar-darwin-arm64",
3+
"version": "0.2.0-rc.3",
4+
"description": "Agent OS native sidecar binary for macOS arm64",
5+
"license": "Apache-2.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/rivet-dev/agent-os.git",
9+
"directory": "packages/sidecar-binary/npm/darwin-arm64"
10+
},
11+
"os": [
12+
"darwin"
13+
],
14+
"cpu": [
15+
"arm64"
16+
],
17+
"files": [
18+
"agentos-sidecar"
19+
],
20+
"engines": {
21+
"node": ">=20"
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "@rivet-dev/agentos-sidecar-darwin-x64",
3+
"version": "0.2.0-rc.3",
4+
"description": "Agent OS native sidecar binary for macOS x64",
5+
"license": "Apache-2.0",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/rivet-dev/agent-os.git",
9+
"directory": "packages/sidecar-binary/npm/darwin-x64"
10+
},
11+
"os": [
12+
"darwin"
13+
],
14+
"cpu": [
15+
"x64"
16+
],
17+
"files": [
18+
"agentos-sidecar"
19+
],
20+
"engines": {
21+
"node": ">=20"
22+
}
23+
}

0 commit comments

Comments
 (0)