ci: upgrade to Node.js 20 for native globalThis.crypto support
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -58,7 +58,7 @@ jobs:
|
|||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '20'
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function getCrypto(): Crypto {
|
|||||||
return window.crypto;
|
return window.crypto;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node.js/Electron environment - globalThis.crypto available in modern runtimes
|
// Node.js/Electron environment - globalThis.crypto available in Node 20+
|
||||||
if (typeof globalThis !== 'undefined' && globalThis.crypto) {
|
if (typeof globalThis !== 'undefined' && globalThis.crypto) {
|
||||||
return globalThis.crypto;
|
return globalThis.crypto;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user