node-bin-gen 11.2.4 → 11.3.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.
- package/.github/workflows/sync-node-version.yml +61 -0
- package/index.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Check and Sync Node.js Versions
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 0 * * *' # everyday
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
sync-node-versions:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repository
|
|
13
|
+
uses: actions/checkout@v3
|
|
14
|
+
|
|
15
|
+
- name: Set up Node.js
|
|
16
|
+
uses: actions/setup-node@v3
|
|
17
|
+
with:
|
|
18
|
+
node-version: '20.x'
|
|
19
|
+
registry-url: 'https://registry.npmjs.org' # set ~/.npmrc need add repository secrets in the settings
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: npm ci
|
|
23
|
+
|
|
24
|
+
- name: Fetch Node.js versions released in the last 30 days
|
|
25
|
+
run: |
|
|
26
|
+
#set -x
|
|
27
|
+
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
|
|
29
|
+
echo "Node.js versions released in the last 30 days:"
|
|
30
|
+
cat versions.txt
|
|
31
|
+
#set +x
|
|
32
|
+
|
|
33
|
+
- name: Check each version and sync if not published
|
|
34
|
+
run: |
|
|
35
|
+
#set -x
|
|
36
|
+
npm whoami # check token access
|
|
37
|
+
while IFS= read -r VERSION; do
|
|
38
|
+
echo "Checking version $VERSION..."
|
|
39
|
+
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 ../../
|
|
55
|
+
else
|
|
56
|
+
echo "Version $VERSION is already published on npm. Skipping."
|
|
57
|
+
fi
|
|
58
|
+
done < versions.txt
|
|
59
|
+
#set +x
|
|
60
|
+
env:
|
|
61
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-bin-gen",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"description": "Generate a node binary package",
|
|
5
5
|
"author": "Aria Stewart <aredridel@dinhe.net>",
|
|
6
6
|
"main": "index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/aredridel/node-bin-gen"
|
|
11
|
+
"url": "git+https://github.com/aredridel/node-bin-gen.git"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"engines": {
|