relayrunner 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/bin/relayrunner.js +40 -0
- package/package.json +10 -21
- package/dist/cli.js +0 -4495
package/README.md
CHANGED
|
@@ -248,6 +248,19 @@ that name.
|
|
|
248
248
|
|
|
249
249
|
## Building
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
The CLI is written in Rust. npm ships it as `relayrunner`, which holds only
|
|
252
|
+
`bin/relayrunner.js`, plus one `@relayrunner/cli-<os>-<cpu>` package per
|
|
253
|
+
platform with the binary (`scripts/npm-packages.mjs` makes them). The Mac app
|
|
254
|
+
bundles the same binary. Its version is `package.json`'s.
|
|
255
|
+
|
|
256
|
+
```sh
|
|
257
|
+
cargo test
|
|
258
|
+
cargo build --release # target/release/relayrunner
|
|
259
|
+
cargo run -- --help # or `pnpm relayrunner --help` from the repo root
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
The messages it exchanges with the gateway are checked against
|
|
263
|
+
`packages/machine-protocol/fixtures.json`, which the protocol package's tests
|
|
264
|
+
check too. `init` edits workflow files line by line rather than reprinting
|
|
265
|
+
them, so everything it doesn't add or change stays as written.
|
|
253
266
|
Releases go out through changesets; see [.changeset/README.md](../../.changeset/README.md).
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Runs the relayrunner binary built for this computer. npm installs it as an optional dependency,
|
|
3
|
+
// one package per platform, and skips the ones for other platforms (scripts/npm-packages.mjs).
|
|
4
|
+
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
|
|
8
|
+
const PLATFORMS = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"];
|
|
9
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
10
|
+
|
|
11
|
+
function binary() {
|
|
12
|
+
if (!PLATFORMS.includes(platform)) {
|
|
13
|
+
console.error("relayrunner runs on macOS and Linux, on x64 or arm64.");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
return createRequire(import.meta.url).resolve(`@relayrunner/cli-${platform}/relayrunner`);
|
|
18
|
+
} catch {
|
|
19
|
+
console.error(
|
|
20
|
+
`relayrunner's binary for ${platform} isn't installed. Reinstall without --omit=optional or --no-optional.`,
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const child = spawn(binary(), process.argv.slice(2), { stdio: "inherit" });
|
|
27
|
+
// Ctrl-C reaches the binary from the terminal already, and a second one means "stop the running
|
|
28
|
+
// jobs now", so this process only waits. Other signals sent to it alone go on to the binary.
|
|
29
|
+
process.on("SIGINT", () => {});
|
|
30
|
+
for (const signal of ["SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
|
|
31
|
+
child.on("error", (error) => {
|
|
32
|
+
console.error(`Couldn't start relayrunner: ${error.message}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
});
|
|
35
|
+
child.on("exit", (code, signal) => {
|
|
36
|
+
if (signal) {
|
|
37
|
+
process.removeAllListeners(signal);
|
|
38
|
+
process.kill(process.pid, signal);
|
|
39
|
+
} else process.exit(code ?? 1);
|
|
40
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relayrunner",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Run GitHub Actions jobs on your machine through the RelayRunner gateway.",
|
|
3
|
+
"version": "0.13.1",
|
|
5
4
|
"license": "Apache-2.0",
|
|
5
|
+
"description": "Run GitHub Actions jobs on your machine through the RelayRunner gateway.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/relayrunner/relayrunner.git",
|
|
@@ -13,26 +13,15 @@
|
|
|
13
13
|
"node": ">=22"
|
|
14
14
|
},
|
|
15
15
|
"bin": {
|
|
16
|
-
"relayrunner": "./
|
|
16
|
+
"relayrunner": "./bin/relayrunner.js"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
-
"
|
|
19
|
+
"bin"
|
|
20
20
|
],
|
|
21
|
-
"
|
|
22
|
-
"@
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
},
|
|
27
|
-
"devDependencies": {
|
|
28
|
-
"@relayrunner/errors": "0.0.0",
|
|
29
|
-
"@relayrunner/machine-protocol": "0.0.0",
|
|
30
|
-
"@relayrunner/providers": "0.0.0",
|
|
31
|
-
"@types/ws": "^8.18.2",
|
|
32
|
-
"tsdown": "^0.23.5",
|
|
33
|
-
"ws": "^8.22.1"
|
|
34
|
-
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsdown"
|
|
21
|
+
"optionalDependencies": {
|
|
22
|
+
"@relayrunner/cli-darwin-arm64": "0.13.1",
|
|
23
|
+
"@relayrunner/cli-darwin-x64": "0.13.1",
|
|
24
|
+
"@relayrunner/cli-linux-arm64": "0.13.1",
|
|
25
|
+
"@relayrunner/cli-linux-x64": "0.13.1"
|
|
37
26
|
}
|
|
38
|
-
}
|
|
27
|
+
}
|