relayrunner 0.12.0 → 0.13.0

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.
@@ -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.12.0",
4
- "description": "Run GitHub Actions jobs on your machine through the RelayRunner gateway.",
3
+ "version": "0.13.0",
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": "./dist/cli.js"
16
+ "relayrunner": "./bin/relayrunner.js"
17
17
  },
18
18
  "files": [
19
- "dist"
19
+ "bin"
20
20
  ],
21
- "dependencies": {
22
- "@clack/prompts": "^1.8.1",
23
- "citty": "^0.2.2",
24
- "yaml": "^2.9.1",
25
- "zod": "^4.6.7"
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.0",
23
+ "@relayrunner/cli-darwin-x64": "0.13.0",
24
+ "@relayrunner/cli-linux-arm64": "0.13.0",
25
+ "@relayrunner/cli-linux-x64": "0.13.0"
37
26
  }
38
- }
27
+ }