@arcadible/github-release-tools 0.1.5 → 0.1.6

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.
@@ -1,13 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
  set -e
3
- PACKAGE="$1"
4
- JSON="$PACKAGE/package.json"
5
- if [ ! -f "$JSON" ]; then
6
- echo "Unable to find ${JSON##*/}: $JSON"
7
- exit 1
8
- else
9
- npm --prefix "$PACKAGE" ci --silent
10
- fi
11
- if jq -e '.scripts.build' "$JSON" >/dev/null 2>&1; then
12
- npm --prefix "$PACKAGE" run build --silent
13
- fi
3
+ SCRIPT="$(realpath "$0")"
4
+ DIR="$(dirname "$SCRIPT")"
5
+ node "$DIR/../src/build.js" "$1"
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ SCRIPT="$(realpath "$0")"
4
+ DIR="$(dirname "$SCRIPT")"
5
+ RESULT=$(node "$DIR/../src/put-build.js" "$1")
6
+ echo "build=$RESULT" >> "$GITHUB_OUTPUT"
package/package.json CHANGED
@@ -3,9 +3,9 @@
3
3
  "arctool-assert-dir": "bin/arctool-assert-dir.sh",
4
4
  "arctool-assert-tag": "bin/arctool-assert-tag.sh",
5
5
  "arctool-build": "bin/arctool-build.sh",
6
+ "arctool-put-build": "bin/arctool-put-build.sh",
6
7
  "arctool-put-deploy-dir": "bin/arctool-put-deploy-dir.sh",
7
8
  "arctool-put-prerelease": "bin/arctool-put-prerelease.sh",
8
- "arctool-put-skip-build": "bin/arctool-put-skip-build.sh",
9
9
  "arctool-put-version": "bin/arctool-put-version.sh"
10
10
  },
11
11
  "dependencies": {
@@ -17,5 +17,5 @@
17
17
  },
18
18
  "license": "Apache-2.0",
19
19
  "name": "@arcadible/github-release-tools",
20
- "version": "0.1.5"
20
+ "version": "0.1.6"
21
21
  }
package/src/build.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ // [import]
4
+
5
+ const cp = require("node:child_process");
6
+
7
+ // [use]
8
+
9
+ const execSync = cp.execSync; // eslint-disable-line no-sync
10
+
11
+ // [define]
12
+
13
+ const command = process.argv[2];
14
+
15
+ // [function]
16
+
17
+ const writeErr = function (data) {
18
+ process.stderr.write(data.trim().concat("\n"));
19
+ };
20
+
21
+ // [main]
22
+
23
+ try {
24
+ if (!command) {
25
+ throw new Error("No command provided.");
26
+ }
27
+ execSync(command, {
28
+ cwd: process.cwd(),
29
+ shell: "/bin/bash",
30
+ stdio: "inherit",
31
+ });
32
+ } catch (ex) {
33
+ writeErr(ex.message);
34
+ process.exit(ex.status || 1);
35
+ }
@@ -32,7 +32,7 @@ try {
32
32
  }
33
33
  const buf = readFileSync(file, "utf8");
34
34
  const conf = JSON.parse(buf);
35
- write(conf?.workflow?.skip_build === false ? "false" : "true");
35
+ write(conf?.workflow?.build ?? "");
36
36
  } catch (ex) {
37
37
  writeErr(ex.message);
38
38
  process.exit(1);
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
- SCRIPT="$(realpath "$0")"
4
- DIR="$(dirname "$SCRIPT")"
5
- RESULT=$(node "$DIR/../src/put-skip-build.js" "$1")
6
- echo "skip_build=$RESULT" >> "$GITHUB_OUTPUT"