Skip to content

Commit ccdd729

Browse files
committed
feat: Add support for riscv64 architecture
1 parent 2bdefb8 commit ccdd729

17 files changed

+865
-678
lines changed

.denolint.json

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

.github/workflows/ci.yml

Lines changed: 32 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,69 +19,55 @@ jobs:
1919
changed: ${{ steps.bump.outputs.bumped }}
2020
changed-files: ${{ steps.bump.outputs.changed-files }}
2121
steps:
22-
- name: Checkout Sources
23-
uses: actions/checkout@v4
24-
- name: Install PNPM
25-
uses: pnpm/action-setup@v2
22+
- uses: actions/checkout@v4
23+
- uses: pnpm/action-setup@v4
2624
with:
2725
version: latest
28-
- name: Install Node
29-
uses: actions/setup-node@v4
26+
- uses: actions/setup-node@v4
3027
with:
3128
node-version: 'lts/*'
29+
registry-url: 'https://registry.npmjs.org'
3230
cache: 'pnpm'
33-
- name: Install Dependencies
34-
run: pnpm i --frozen-lockfile --no-verify-store-integrity
35-
- name: Build
36-
run: npm run build
37-
- name: Test
38-
run: npm test
31+
- run: pnpm i --frozen-lockfile --no-verify-store-integrity
32+
- run: npm run build
33+
- run: npm test
3934

4035
macos:
41-
runs-on: macos-latest
36+
runs-on: macos-13
4237
steps:
43-
- name: Checkout Sources
44-
uses: actions/checkout@v4
45-
- name: Install PNPM
46-
uses: pnpm/action-setup@v2
38+
- uses: actions/checkout@v4
39+
- uses: pnpm/action-setup@v4
4740
with:
4841
version: latest
49-
- name: Install Node
50-
uses: actions/setup-node@v4
42+
- uses: actions/setup-node@v4
5143
with:
5244
node-version: 'lts/*'
45+
registry-url: 'https://registry.npmjs.org'
5346
cache: 'pnpm'
54-
- name: Install Dependencies
55-
run: pnpm i --frozen-lockfile --no-verify-store-integrity
56-
- name: Build
57-
run: npm run build
58-
- name: Test
59-
run: |
47+
- run: pnpm i --frozen-lockfile --no-verify-store-integrity
48+
- run: npm run build
49+
- run: |
6050
npm run test-cover
6151
./test.sh
62-
- name: Coverage
63-
uses: codecov/codecov-action@v2
52+
- uses: codecov/codecov-action@v4
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
6455

6556
windows:
6657
runs-on: windows-latest
6758
steps:
68-
- name: Checkout Sources
69-
uses: actions/checkout@v4
70-
- name: Install PNPM
71-
uses: pnpm/action-setup@v2
59+
- uses: actions/checkout@v4
60+
- uses: pnpm/action-setup@v4
7261
with:
7362
version: latest
74-
- name: Install Node
75-
uses: actions/setup-node@v4
63+
- uses: actions/setup-node@v4
7664
with:
7765
node-version: 'lts/*'
66+
registry-url: 'https://registry.npmjs.org'
7867
cache: 'pnpm'
79-
- name: Install Dependencies
80-
run: pnpm i --frozen-lockfile --no-verify-store-integrity
81-
- name: Build
82-
run: npm run build
83-
- name: Test
84-
run: npm test
68+
- run: pnpm i --frozen-lockfile --no-verify-store-integrity
69+
- run: npm run build
70+
- run: npm test
8571

8672
release:
8773
if: ${{ github.ref_name == 'master' }}
@@ -91,24 +77,18 @@ jobs:
9177
- windows
9278
runs-on: ubuntu-latest
9379
steps:
94-
- name: Checkout Sources
95-
uses: actions/checkout@v4
96-
- name: Install PNPM
97-
uses: pnpm/action-setup@v2
80+
- uses: actions/checkout@v4
81+
- uses: pnpm/action-setup@v4
9882
with:
9983
version: latest
100-
- name: Install Node
101-
uses: actions/setup-node@v4
84+
- uses: actions/setup-node@v4
10285
with:
10386
node-version: 'lts/*'
104-
cache: 'pnpm'
10587
registry-url: 'https://registry.npmjs.org'
106-
- name: Install Dependencies
107-
run: pnpm i --frozen-lockfile --no-verify-store-integrity
108-
- name: Build
109-
run: npm run build
110-
- name: Publish Release
111-
uses: prantlf/publish-release-action@v1
88+
cache: 'pnpm'
89+
- run: pnpm i --frozen-lockfile --no-verify-store-integrity
90+
- run: npm run build
91+
- uses: prantlf/publish-release-action@v1
11292
with:
11393
no-archives: true
11494
env:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ where:
3232

3333
* `{name}` is the name of the tool (executable)
3434
* `{platform}` is the name of the target platform, by default: `linux`, `darwin` (also `macos`) and `win32` (also `windows`)
35-
* `{architecture}` is the name of the target architecture, by default `arm64` (also `aarch64`) and `x64` (also `amd64`, `x86_64` or `x86`)
35+
* `{architecture}` is the name of the target architecture, by default `arm64` (also `aarch64`), `riscv64` and `x64` (also `amd64`, `x86_64` or `x86`)
3636

3737
## Installation
3838

@@ -103,6 +103,7 @@ interface GrabOptions {
103103
platformSuffixes?: ArchiveSuffixes
104104
// recognised architectures organised by the Node.js platform name; defaults:
105105
// - arm64: aarch64, arm64
106+
// - riscv64: riscv64
106107
// - x64: amd64, x86_64, x64, x86
107108
archSuffixes?: ArchiveSuffixes
108109
// directory to write the archive or executable to; if not specified,

bin/grab-github-release.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,18 @@ function fail(message) {
3939
}
4040

4141
const { argv } = process
42-
let clearCache, repository, version, name, platformSuffixes, archSuffixes,
43-
targetDirectory, unpackExecutable, cache, forceCache, token, verbose
42+
let clearCache
43+
let repository
44+
let version
45+
let name
46+
let platformSuffixes
47+
let archSuffixes
48+
let targetDirectory
49+
let unpackExecutable
50+
let cache
51+
let forceCache
52+
let token
53+
let verbose
4454

4555
for (let i = 2, l = argv.length; i < l; ++i) {
4656
const arg = argv[i]
@@ -99,9 +109,9 @@ for (let i = 2, l = argv.length; i < l; ++i) {
99109
return
100110
case 'V': case 'version-spec':
101111
{
102-
const { readFile } = await import('fs/promises')
103-
const { fileURLToPath } = await import('url')
104-
const { join, dirname } = await import('path')
112+
const { readFile } = await import('node:fs/promises')
113+
const { fileURLToPath } = await import('node:url')
114+
const { join, dirname } = await import('node:path')
105115
const pkg = join(dirname(fileURLToPath(import.meta.url)), '../package.json')
106116
console.log(JSON.parse(await readFile(pkg, 'utf8')).version)
107117
process.exit(0)

biome.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"files": {
7+
"ignore": ["dist/**"]
8+
},
9+
"linter": {
10+
"enabled": true,
11+
"rules": {
12+
"recommended": true,
13+
"style": {
14+
"noParameterAssign": "off"
15+
},
16+
"complexity": {
17+
"useArrowFunction": "off"
18+
}
19+
}
20+
},
21+
"formatter": {
22+
"enabled": true,
23+
"formatWithErrors": false,
24+
"indentStyle": "space",
25+
"indentWidth": 2,
26+
"lineEnding": "lf",
27+
"lineWidth": 90
28+
},
29+
"javascript": {
30+
"formatter": {
31+
"arrowParentheses": "asNeeded",
32+
"bracketSpacing": true,
33+
"quoteProperties": "asNeeded",
34+
"quoteStyle": "single",
35+
"semicolons": "asNeeded",
36+
"trailingComma": "none"
37+
}
38+
},
39+
"json": {
40+
"parser": {
41+
"allowComments": false,
42+
"allowTrailingCommas": false
43+
},
44+
"formatter": {
45+
"enabled": true,
46+
"trailingCommas": "none"
47+
}
48+
}
49+
}

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
],
4444
"scripts": {
4545
"build": "rollup -c && cp-j src/index.d.ts dist/",
46-
"lint": "denolint && tsc --noEmit test/types.test.ts",
46+
"lint": "biome lint *.js bin src test && tsc --noEmit test/types.test.ts",
4747
"check": "node test/cjs.cjs && node test/mocked && node test/real",
4848
"cover": "c8 node test/mocked",
4949
"test": "tsc --noEmit test/types.test.ts && node test/cjs.cjs && node test/mocked && node test/real",
@@ -61,18 +61,18 @@
6161
"statements": 100
6262
},
6363
"dependencies": {
64-
"debug": "^4.3.4",
65-
"semver": "^7.6.0",
66-
"yauzl": "^3.1.2"
64+
"debug": "^4.3.6",
65+
"semver": "^7.6.3",
66+
"yauzl": "^3.1.3"
6767
},
6868
"devDependencies": {
69+
"@biomejs/biome": "^1.8.3",
6970
"@unixcompat/cp.js": "^3.0.0",
70-
"c8": "^9.1.0",
71-
"denolint": "2.0.14",
71+
"c8": "^10.1.2",
7272
"grab-github-release": "link:",
73-
"rollup": "^4.13.2",
73+
"rollup": "^4.20.0",
7474
"rollup-plugin-cleanup": "^3.2.1",
75-
"typescript": "^5.4.3"
75+
"typescript": "^5.5.4"
7676
},
7777
"keywords": [
7878
"github",

0 commit comments

Comments
 (0)