node-bin-gen 11.3.0 → 12.1.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.
@@ -5,57 +5,70 @@ on:
5
5
  - cron: '0 0 * * *' # everyday
6
6
  workflow_dispatch:
7
7
 
8
+ permissions:
9
+ id-token: write
10
+ contents: read
11
+
8
12
  jobs:
9
13
  sync-node-versions:
10
14
  runs-on: ubuntu-latest
11
15
  steps:
12
16
  - name: Checkout repository
13
- uses: actions/checkout@v3
17
+ uses: actions/checkout@v4
14
18
 
15
19
  - name: Set up Node.js
16
- uses: actions/setup-node@v3
20
+ uses: actions/setup-node@v4
17
21
  with:
18
- node-version: '20.x'
22
+ node-version: '24.x'
19
23
  registry-url: 'https://registry.npmjs.org' # set ~/.npmrc need add repository secrets in the settings
20
24
 
25
+ - name: Ensure latest npm 11
26
+ run: npm install -g npm@11
27
+
21
28
  - name: Install dependencies
22
29
  run: npm ci
23
30
 
24
31
  - name: Fetch Node.js versions released in the last 30 days
25
32
  run: |
26
- #set -x
33
+ set -x
27
34
  DATE_30_DAYS_AGO=$(date --date='30 days ago' +%Y-%m-%d)
28
- curl -s https://nodejs.org/dist/index.json | jq --arg DATE "$DATE_30_DAYS_AGO" -r '.[] | select(.date >= $DATE) | .version' > versions.txt
35
+ curl -s https://nodejs.org/dist/index.json | jq --arg DATE "$DATE_30_DAYS_AGO" -r '.[] | select(.date >= $DATE) | .version' | sed -e 's@^v@@g' | sort > versions.txt
29
36
  echo "Node.js versions released in the last 30 days:"
30
37
  cat versions.txt
31
- #set +x
32
38
 
33
39
  - name: Check each version and sync if not published
34
40
  run: |
35
- #set -x
36
- npm whoami # check token access
41
+ set -x
37
42
  while IFS= read -r VERSION; do
38
43
  echo "Checking version $VERSION..."
39
44
  if [ -z "$(npm view node@$VERSION)" ]; then
40
- echo "Version $VERSION is not published on npm. Running custom script."
41
- mkdir -p "target/$VERSION" && cd "target/$VERSION"
42
- node ../../index.js $VERSION
43
- for dir in */ ; do
44
- if [ -d "$dir" ]; then
45
- echo "Publishing directory: $dir"
46
- cd "$dir"
47
- npm publish
48
- # npm publish --dry-run
49
- cd ..
50
- else
51
- echo "Directory $dir not found."
52
- fi
53
- done
54
- cd ../../
45
+ echo "Version $VERSION is not published on npm."
46
+ (
47
+ mkdir -p "target/$VERSION" && cd "target/$VERSION"
48
+ node ../../index.js $VERSION
49
+ for dir in */ ; do
50
+ pkg="$(cat $dir/package.json | jq -r .name)"
51
+ if [ -z "$(npm view $pkg@$VERSION)" ]; then
52
+ echo "$pkg has not been published."
53
+ echo "Publishing directory: $dir"
54
+ npm view $pkg version | IFS=. read MAJOR MINOR PATCH
55
+ echo $VERSION | IFS=. read NEWMAJ NEWMIN NEWPATCH
56
+ if [ $NEWMAJOR -gt $MAJOR ] || [ $NEWMAJOR = $MAJOR -a $NEWMINOR -gt $MINOR ] || [ $NEWMAJOR = $MAJOR -a $NEWMINOR = $MINOR -a $NEWPATCH -gt $PATCH ]; then
57
+ TAG=latest
58
+ else
59
+ TAG=v$NEWMAJOR-latest
60
+ fi
61
+ (
62
+ cd "$dir"
63
+ npm publish --tag="$TAG"
64
+ # npm publish --dry-run
65
+ )
66
+ else
67
+ echo "$pkg@$VERSION is already published on npm. Skipping."
68
+ fi
69
+ done
70
+ )
55
71
  else
56
72
  echo "Version $VERSION is already published on npm. Skipping."
57
73
  fi
58
74
  done < versions.txt
59
- #set +x
60
- env:
61
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/index.js CHANGED
@@ -76,11 +76,15 @@ async function buildArchPackage(os, cpu, version, pre) {
76
76
  os +
77
77
  "-" +
78
78
  cpu,
79
- version: version + (pre != null ? "-" + pre : ""),
79
+ version: version.replace(/^v/, "") + (pre != null ? "-" + pre : ""),
80
80
  description: "node",
81
+ repository: {
82
+ url: "git+https://github.com/aredridel/node-bin-gen.git"
83
+ },
81
84
  bin: {
82
85
  node: executable,
83
86
  },
87
+ license: "MIT",
84
88
  files: [
85
89
  os == "win" ? "bin/node.exe" : "bin/node",
86
90
  "share",
@@ -271,7 +275,7 @@ async function buildMetapackage(version) {
271
275
  dependencies: {
272
276
  "node-bin-setup": "^1.0.0",
273
277
  },
274
- license: "ISC",
278
+ license: "MIT",
275
279
  author: "",
276
280
  engines: {
277
281
  npm: ">=5.0.0",
@@ -12,6 +12,16 @@ Use
12
12
  npm i ${packagename}@lts
13
13
  ```
14
14
 
15
+ > **Note:** This package uses a `preinstall` script to download the correct binary for your platform. Newer versions of npm block install scripts by default. If installation fails or the `node` binary is missing, add the following to your `package.json` and reinstall:
16
+ >
17
+ > ```json
18
+ > {
19
+ > "allowScripts": ["${packagename}"]
20
+ > }
21
+ > ```
22
+ >
23
+ > Or run `npm approve-scripts` after installation.
24
+
15
25
  Use with `npx`
16
26
  --------------
17
27
 
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "node-bin-gen",
3
- "version": "11.3.0",
3
+ "version": "12.1.0",
4
4
  "description": "Generate a node binary package",
5
5
  "author": "Aria Stewart <aredridel@dinhe.net>",
6
6
  "main": "index.js",
7
- "bin": "index.js",
8
7
  "license": "ISC",
9
8
  "repository": {
10
9
  "type": "git",
@@ -15,9 +14,9 @@
15
14
  "node": ">=18.0.0"
16
15
  },
17
16
  "dependencies": {
18
- "rimraf": "^5.0.5",
17
+ "rimraf": "^6.0.0",
19
18
  "verror": "^1.9.0",
20
- "yargs": "^17.0.1"
19
+ "yargs": "^18.0.0"
21
20
  },
22
21
  "eslintConfig": {
23
22
  "sourceType": "module",
@@ -40,6 +39,9 @@
40
39
  }
41
40
  },
42
41
  "devDependencies": {
43
- "eslint": "^8.50.0"
42
+ "eslint": "^10.0.2"
43
+ },
44
+ "bin": {
45
+ "node-bin-gen": "index.js"
44
46
  }
45
- }
47
+ }