Skip to content

Commit 745a3a3

Browse files
authored
chore: fix auto release workflow config (#59)
[skip ci] <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Node.js 24 to the test matrix and enabled grouped merge handling in CI. * **Documentation** * Expanded Mirrors section with Website, JSON and CDN entries. * Simplified contributor area to a badge. * **Chores** * Switched linting toolchain and removed the project ESLint configuration. * Updated CI to include a lint job and tightened workflow permissions. * **Tests** * Tests updated to use Node's built-in test runner and test script adjusted. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a8db2a4 commit 745a3a3

File tree

7 files changed

+37
-28
lines changed

7 files changed

+37
-28
lines changed

.eslintrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/nodejs.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,26 @@ on:
55
branches: [ master ]
66
pull_request:
77
branches: [ master ]
8+
merge_group:
89

910
jobs:
1011
Job:
1112
name: Node.js
1213
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
1314
with:
1415
os: 'ubuntu-latest'
15-
version: '14, 16, 18, 20, 22'
16+
version: '16, 18, 20, 22, 24'
17+
18+
lint:
19+
name: Lint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
- name: Use Node.js
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: '22'
27+
- name: Install dependencies
28+
run: npm install
29+
- name: Lint
30+
run: npx oxlint

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ on:
44
push:
55
branches: [ master ]
66

7+
permissions:
8+
contents: write
9+
deployments: write
10+
issues: write
11+
pull-requests: write
12+
id-token: write
13+
714
jobs:
815
release:
916
name: Node.js
1017
uses: cnpm/github-actions/.github/workflows/node-release.yml@master
1118
secrets:
12-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1319
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,16 @@ Binary mirror config for [prebuild](https://github.com/mafintosh/prebuild) and [
1717

1818
## Mirrors
1919

20-
- China: <https://npmmirror.com/mirrors/>
21-
- CDN prefix: <https://cdn.npmmirror.com/binaries/>
20+
- Web Site: <https://npmmirror.com/mirrors/>
21+
- JSON endpoint: <https://registry.npmmirror.com/-/binary>
22+
- CDN endpoint prefix: <https://cdn.npmmirror.com/binaries/>
2223

2324
## License
2425

2526
[MIT](LICENSE)
2627

27-
<!-- GITCONTRIBUTOR_START -->
28-
2928
## Contributors
3029

31-
|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/4635838?v=4" width="100px;"/><br/><sub><b>gemwuu</b></sub>](https://github.com/gemwuu)<br/>|[<img src="https://avatars.githubusercontent.com/u/32174276?v=4" width="100px;"/><br/><sub><b>semantic-release-bot</b></sub>](https://github.com/semantic-release-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/6897780?v=4" width="100px;"/><br/><sub><b>killagu</b></sub>](https://github.com/killagu)<br/>|[<img src="https://avatars.githubusercontent.com/u/1119126?v=4" width="100px;"/><br/><sub><b>looksgood</b></sub>](https://github.com/looksgood)<br/>|[<img src="https://avatars.githubusercontent.com/u/36290410?v=4" width="100px;"/><br/><sub><b>WEN-JY</b></sub>](https://github.com/WEN-JY)<br/>|
32-
| :---: | :---: | :---: | :---: | :---: | :---: |
33-
[<img src="https://avatars.githubusercontent.com/u/6996341?v=4" width="100px;"/><br/><sub><b>yuler</b></sub>](https://github.com/yuler)<br/>|[<img src="https://avatars.githubusercontent.com/u/4136679?v=4" width="100px;"/><br/><sub><b>yibn2008</b></sub>](https://github.com/yibn2008)<br/>|[<img src="https://avatars.githubusercontent.com/u/985607?v=4" width="100px;"/><br/><sub><b>dead-horse</b></sub>](https://github.com/dead-horse)<br/>|[<img src="https://avatars.githubusercontent.com/u/5574625?v=4" width="100px;"/><br/><sub><b>elrrrrrrr</b></sub>](https://github.com/elrrrrrrr)<br/>|[<img src="https://avatars.githubusercontent.com/u/2784308?v=4" width="100px;"/><br/><sub><b>yisibl</b></sub>](https://github.com/yisibl)<br/>
34-
35-
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat May 11 2024 21:19:34 GMT+0800`.
30+
[![Contributors](https://contrib.rocks/image?repo=cnpm/binary-mirror-config)](https://github.com/cnpm/binary-mirror-config/graphs/contributors)
3631

37-
<!-- GITCONTRIBUTOR_END -->
32+
Made with [contributors-img](https://contrib.rocks).

lib/mirror_config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ exports.MirrorConfig = class MirrorConfig {
7373
content = content.replace('if (protocol === \'http:\') {',
7474
'if (false && protocol === \'http:\') { // hack by npminstall');
7575
await fs.writeFile(versioningFile, content);
76-
} catch (_) {
76+
} catch {
7777
// ignore error
7878
}
7979
}
@@ -121,10 +121,10 @@ exports.MirrorConfig = class MirrorConfig {
121121
// return version ? prepend('desktop/' + version) : prepend('desktop');
122122
const afterContent = 'return "' + binaryMirror.host + '/" + version + "/' + targetPlatform + '/cypress.zip"; // hack by npminstall\n';
123123
content = content
124-
.replace('return version ? prepend(\`desktop/${version}\`) : prepend(\'desktop\')', afterContent)
124+
.replace('return version ? prepend(`desktop/${version}`) : prepend(\'desktop\')', afterContent)
125125
.replace('return version ? prepend(\'desktop/\' + version) : prepend(\'desktop\');', afterContent);
126126
await fs.writeFile(downloadFile, content);
127-
} catch (error) {
127+
} catch {
128128
// ignore error
129129
}
130130
}
@@ -150,7 +150,7 @@ exports.MirrorConfig = class MirrorConfig {
150150
async replaceHostInFile(pkg, filepath, binaryMirror) {
151151
try {
152152
await fs.stat(filepath);
153-
} catch (e) {
153+
} catch {
154154
return;
155155
}
156156

package.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,16 @@
88
"lib"
99
],
1010
"scripts": {
11-
"contributor": "git-contributor",
12-
"test": "npm run lint && egg-bin test",
13-
"test-cov": "egg-bin cov",
14-
"lint": "eslint test index.js",
15-
"ci": "npm run lint && npm run test-cov"
11+
"test": "oxlint && node --test",
12+
"ci": "node --test"
1613
},
1714
"dependencies": {
1815
"chalk": "^2.4.2",
1916
"semver": "^7.3.7",
2017
"urllib": "^3.3.0"
2118
},
2219
"devDependencies": {
23-
"egg-bin": "6",
24-
"eslint": "8",
25-
"eslint-config-egg": "12",
26-
"git-contributor": "2"
20+
"oxlint": "^1.24.0"
2721
},
2822
"engines": {
2923
"node": ">=14.0.0"

test/index.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ const { MockAgent, getGlobalDispatcher, setGlobalDispatcher } = require('urllib'
33
const fs = require('fs').promises;
44
const os = require('os');
55
const path = require('path');
6+
const { describe, it, before, after, beforeEach, afterEach } = require('node:test');
7+
68
const pkgJSON = require('../package.json');
79
const { MirrorConfig, mirrors } = require('..');
810

0 commit comments

Comments
 (0)