@arcadible/github-release-tools 1.0.15 → 1.0.17

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 CHANGED
@@ -31,8 +31,9 @@ When `arc deploy git` pushes a release tag, the Arcadible Release workflow build
31
31
  | `arctool-put-deploy-dir <manifest>` | Outputs `deploy_dir` |
32
32
  | `arctool-put-cache <manifest>` | Outputs `cache`, the package manager whose lockfile is beside the manifest |
33
33
  | `arctool-install-deps <dir>` | Installs the project's dependencies exactly as its lockfile pins them |
34
+ | `arctool-put-artifact <file>` | Checks that `arc pack` wrote the package, and outputs `artifact`, its path |
34
35
 
35
- `<manifest>` is the file `arc inspect --json` writes. Each `put` command writes its value to the step's `GITHUB_OUTPUT`. `arctool-install-deps` runs `npm ci`, or pnpm or Yarn through corepack, and does nothing without a lockfile. A command that fails says why on stderr, and exits 1.
36
+ `<manifest>` is the file `arc inspect --json` writes. `<file>` is the package `arc pack` wrote. Each `put` command writes its value to the step's `GITHUB_OUTPUT`. `arctool-install-deps` runs `npm ci`, or pnpm or Yarn through corepack, and does nothing without a lockfile. A command that fails says why on stderr, and exits 1.
36
37
 
37
38
  ## License
38
39
 
@@ -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-artifact.js" "$1")
6
+ echo "artifact=$RESULT" >> "$GITHUB_OUTPUT"
package/package.json CHANGED
@@ -4,6 +4,7 @@
4
4
  "arctool-assert-dir": "bin/arctool-assert-dir.sh",
5
5
  "arctool-assert-tag": "bin/arctool-assert-tag.sh",
6
6
  "arctool-install-deps": "bin/arctool-install-deps.sh",
7
+ "arctool-put-artifact": "bin/arctool-put-artifact.sh",
7
8
  "arctool-put-build": "bin/arctool-put-build.sh",
8
9
  "arctool-put-cache": "bin/arctool-put-cache.sh",
9
10
  "arctool-put-deploy-dir": "bin/arctool-put-deploy-dir.sh",
@@ -32,5 +33,5 @@
32
33
  "scripts": {
33
34
  "test": "node --test \"test/**/*.test.js\""
34
35
  },
35
- "version": "1.0.15"
36
+ "version": "1.0.17"
36
37
  }
package/src/assert-dir.js CHANGED
@@ -7,7 +7,7 @@ const fs = require("node:fs");
7
7
 
8
8
  // [import]
9
9
 
10
- const io = require("./io");
10
+ const io = require("./util/io");
11
11
 
12
12
  // [use]
13
13
 
package/src/assert-tag.js CHANGED
@@ -8,7 +8,7 @@ const semver = require("semver");
8
8
 
9
9
  // [import]
10
10
 
11
- const io = require("./io");
11
+ const io = require("./util/io");
12
12
 
13
13
  // [use]
14
14
 
@@ -6,8 +6,8 @@ const cp = require("node:child_process");
6
6
 
7
7
  // [import]
8
8
 
9
- const detect = require("./lockfile");
10
- const io = require("./io");
9
+ const detect = require("./util/lockfile");
10
+ const io = require("./util/io");
11
11
 
12
12
  // [use]
13
13
 
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // arctool-put-artifact <file>: the package arc pack wrote, a file that isn't
3
+ // empty. Unlike the other put commands, it takes a path, not the manifest,
4
+ // and doesn't look at the format, so a package that isn't a zip needs no
5
+ // change here.
6
+
7
+ // [import]
8
+
9
+ const fs = require("node:fs");
10
+
11
+ // [import]
12
+
13
+ const io = require("./util/io");
14
+
15
+ // [use]
16
+
17
+ const fail = io.fail;
18
+ const run = io.run;
19
+ const statSync = fs.statSync; // eslint-disable-line no-sync
20
+ const write = io.write;
21
+
22
+ // [define]
23
+
24
+ const file = process.argv[2];
25
+
26
+ // [main]
27
+
28
+ run(() => {
29
+ if (!file) {
30
+ fail("No file provided.");
31
+ }
32
+ const info = statSync(file, { throwIfNoEntry: false });
33
+ if (!info) {
34
+ fail(`Unable to find: ${file}`, "arc pack didn't write it.");
35
+ }
36
+ if (!info.isFile()) {
37
+ fail(
38
+ `Unable to find: ${file}`,
39
+ "It's a folder, and the package is a file.",
40
+ );
41
+ }
42
+ if (info.size === 0) {
43
+ fail(`Unable to use: ${file}`, "It's empty.");
44
+ }
45
+ write(file);
46
+ });
package/src/put-build.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  // [import]
7
7
 
8
- const io = require("./io");
8
+ const io = require("./util/io");
9
9
 
10
10
  // [use]
11
11
 
package/src/put-cache.js CHANGED
@@ -8,8 +8,8 @@ const path = require("node:path");
8
8
 
9
9
  // [import]
10
10
 
11
- const detect = require("./lockfile");
12
- const io = require("./io");
11
+ const detect = require("./util/lockfile");
12
+ const io = require("./util/io");
13
13
 
14
14
  // [use]
15
15
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  // [import]
6
6
 
7
- const io = require("./io");
7
+ const io = require("./util/io");
8
8
 
9
9
  // [use]
10
10
 
@@ -8,7 +8,7 @@ const semver = require("semver");
8
8
 
9
9
  // [import]
10
10
 
11
- const io = require("./io");
11
+ const io = require("./util/io");
12
12
 
13
13
  // [use]
14
14
 
@@ -7,7 +7,7 @@ const semver = require("semver");
7
7
 
8
8
  // [import]
9
9
 
10
- const io = require("./io");
10
+ const io = require("./util/io");
11
11
 
12
12
  // [use]
13
13
 
File without changes
File without changes