Skip to content

Commit 7327554

Browse files
authored
Merge pull request #81 from nodenv/workflows
workflows
2 parents bdb6ddc + b4036ae commit 7327554

17 files changed

+3130
-5873
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: Release
22
on:
3-
push: { tags: 'v[0-9]+.[0-9]+.[0-9]+*' }
4-
5-
permissions: {contents: write, id-token: write}
3+
push: { tags: "v[0-9]+.[0-9]+.[0-9]+*" }
64

5+
permissions: {}
76
jobs:
87
release:
9-
uses: nodenv/.github/.github/workflows/release.yml@v4
8+
permissions: { contents: write, id-token: write }
9+
uses: nodenv/.github/.github/workflows/release.yml@v6
1010
secrets: inherit

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: Test
22
on:
33
push:
44
pull_request:
5+
schedule: [{ cron: "0 0 10 * *" }] # monthly https://crontab.guru/#0_0_10_*_*
56
workflow_dispatch:
6-
schedule: [{cron: '0 0 10 * *'}] # monthly https://crontab.guru/#0_0_10_*_*
7-
8-
permissions: read-all
97

8+
permissions: {}
109
jobs:
1110
test:
12-
uses: nodenv/.github/.github/workflows/test.yml@v4
11+
uses: nodenv/.github/.github/workflows/test.yml@v6
12+
with: { npm: false }
1313
permissions:
1414
contents: read
1515
packages: read

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
/node_modules
2+
/package*/
3+
/tmp
4+
25
/nodenv-node-build-update-defs-*.tgz
36

47
# normally, it's okay for node-version to be committed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ create [node-build][]-compatible definitions from [nodejs.org](https://nodejs.or
1010
<!-- toc -->
1111

1212
- [Installation](#installation)
13-
* [Installing with Git](#installing-with-git)
14-
* [Installing with Homebrew](#installing-with-homebrew)
15-
* [Installation with npm](#installation-with-npm)
13+
- [Installing with Git](#installing-with-git)
14+
- [Installing with Homebrew](#installing-with-homebrew)
15+
- [Installation with npm](#installation-with-npm)
1616
- [Requirements](#requirements)
1717
- [Usage](#usage)
18-
* [Special environment variables](#special-environment-variables)
18+
- [Special environment variables](#special-environment-variables)
1919
- [Cleanup/Pruning](#cleanuppruning)
2020

2121
<!-- tocstop -->
2222

2323
## Installation
2424

25-
Recommended installation is via git clone into your nodenv root, as per below.
26-
However, this plugin may also be installed via homebrew or npm.
25+
Recommended installation is via Git clone into your nodenv root, as per below.
26+
However, this plugin may also be installed via Homebrew or npm.
2727
If installed outside of `NODENV_ROOT`, you must ensure its `share/node-build` directory has been added to the `NODE_BUILD_DEFINITIONS` path.
2828

2929
### Installing with Git
@@ -69,14 +69,14 @@ See [special environment variables](#special-environment-variables)
6969

7070
Only definitions that aren't already in node-build's lookup path (`NODE_BUILD_DEFINITIONS`) will be created.
7171
That is, under typical usage only definitions not already shipped with node-build will be created.
72-
To override this and write definitions for *all* available node/io versions, use `--force`.
72+
To override this and write definitions for _all_ available node/io versions, use `--force`.
7373
(This will overwrite any conflicting definition files that already exist in the destination directory.)
7474

7575
### Special environment variables
7676

7777
- `NODE_BUILD_DEFINITIONS` can be a list of colon-separated paths that get additionally searched when looking up build definitions.
78-
The `share/node-build/` directories of any plugin under `$(nodenv root)/plugins` are appended to this path by `nodenv install` automatically.
79-
Definitions already found in these paths will be skipped (unless `--force`).
78+
The `share/node-build/` directories of any plugin under `$(nodenv root)/plugins` are appended to this path by `nodenv install` automatically.
79+
Definitions already found in these paths will be skipped (unless `--force`).
8080

8181
## Cleanup/Pruning
8282

@@ -88,8 +88,8 @@ In order to ensure one is frequently running on the "proper" build definitions f
8888

8989
This subcommand removes (or lists with `--dry-run`) any duplicate build definitions.
9090
Like `update-version-defs`, `--destination <dir>` overrides the default value of `<plugin-root>/share/node-build` as the directory from which duplicates are removed.
91-
Duplicates are searched for under `NODE_BUILD_DEFINITIONS` and are determined by both filename *and* contents.
92-
The file contents check can be overridden with `--force`, which will delete duplicates based solely on filename.
91+
Duplicates are searched for under `NODE_BUILD_DEFINITIONS` and are determined by both filename _and_ contents.
92+
The file contents check can be overridden with `--force`, which will delete duplicates based solely on filename.
9393

9494
This subcommand is silent by default, only printing removed duplicates if `--verbose`.
9595
(`--dry-run` implies `--verbose`)

eslint.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import neostandard from "neostandard";
2+
3+
export default neostandard({
4+
noStyle: true, // compat with prettier
5+
});

index.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
const DefinitionFile = require('./src/definition-file')
2-
const GithubScraper = require('./src/scraper-github')
3-
const NodejsOrgScraper = require('./src/scraper-nodejs_org')
1+
const DefinitionFile = require("./src/definition-file")
2+
const GithubScraper = require("./src/scraper-github")
3+
const NodejsOrgScraper = require("./src/scraper-nodejs_org")
44

55
const scrapers = {
66
nodejs: new NodejsOrgScraper({
7-
displayName: 'nodejs',
8-
baseUri: 'https://nodejs.org/dist/'
7+
displayName: "nodejs",
8+
baseUri: "https://nodejs.org/dist/"
99
}),
1010

11-
'nodejs-pre': new NodejsOrgScraper({
12-
displayName: 'nodejs release candidate',
13-
baseUri: 'https://nodejs.org/download/rc/'
11+
"nodejs-pre": new NodejsOrgScraper({
12+
displayName: "nodejs release candidate",
13+
baseUri: "https://nodejs.org/download/rc/"
1414
}),
1515

16-
'nodejs-nightly': new NodejsOrgScraper({
17-
displayName: 'nodejs nightly',
18-
baseUri: 'https://nodejs.org/download/nightly/'
16+
"nodejs-nightly": new NodejsOrgScraper({
17+
displayName: "nodejs nightly",
18+
baseUri: "https://nodejs.org/download/nightly/"
1919
}),
2020

2121
chakracore: new NodejsOrgScraper({
22-
name: 'chakracore',
23-
baseUri: 'https://nodejs.org/download/chakracore-release/'
22+
name: "chakracore",
23+
baseUri: "https://nodejs.org/download/chakracore-release/"
2424
}),
2525

26-
'chakracore-pre': new NodejsOrgScraper({
27-
name: 'chakracore',
28-
displayName: 'chakracore release candidate',
29-
baseUri: 'https://nodejs.org/download/chakracore-rc/'
26+
"chakracore-pre": new NodejsOrgScraper({
27+
name: "chakracore",
28+
displayName: "chakracore release candidate",
29+
baseUri: "https://nodejs.org/download/chakracore-rc/"
3030
}),
3131

32-
'chakracore-nightly': new NodejsOrgScraper({
33-
name: 'chakracore',
34-
displayName: 'chakracore nightly',
35-
baseUri: 'https://nodejs.org/download/chakracore-nightly/'
32+
"chakracore-nightly": new NodejsOrgScraper({
33+
name: "chakracore",
34+
displayName: "chakracore nightly",
35+
baseUri: "https://nodejs.org/download/chakracore-nightly/"
3636
}),
3737

3838
graal: new GithubScraper({
39-
name: 'graal+ce',
40-
org: 'oracle',
41-
repo: 'graal',
42-
filterReleases: releases =>
39+
name: "graal+ce",
40+
org: "oracle",
41+
repo: "graal",
42+
filterReleases: (releases) =>
4343
releases
44-
.filter(r => /^vm-/.test(r.tag_name))
45-
.map(r => ({
46-
tag_name: r.tag_name.replace(/^vm-/, ''),
44+
.filter((r) => /^vm-/.test(r.tag_name))
45+
.map((r) => ({
46+
tag_name: r.tag_name.replace(/^vm-/, ""),
4747
assets: r.assets
4848
}))
4949
})
5050
}
5151

52-
module.exports = function scrape (options) {
52+
module.exports = function scrape(options) {
5353
DefinitionFile.configure(options)
5454

55-
options.run.forEach(scraper => scrapers[scraper].scrape(options))
55+
options.run.forEach((scraper) => scrapers[scraper].scrape(options))
5656
}

0 commit comments

Comments
 (0)