diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 534a3c70..1fb0cfd3 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -542,6 +542,9 @@ jobs: - name: Move artifacts run: pnpm artifacts + - name: Download ICU for Windows + run: node ./scripts/release-skia-binary.js --download-icu + - name: List packages run: ls -R ./npm shell: bash diff --git a/npm/icudtl/README.md b/npm/icudtl/README.md deleted file mode 100644 index 4cc0a8a4..00000000 --- a/npm/icudtl/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# `@napi-rs/canvas-icudtl-win32-x64` - -External ICU dat for [canvas](https://github.com/Brooooooklyn/canvas) Windows x64 platform. - -https://github.com/google/skia/blob/master/third_party/icu/SkLoadICU.cpp#L6 diff --git a/npm/icudtl/package.json b/npm/icudtl/package.json deleted file mode 100644 index 4e90ccfa..00000000 --- a/npm/icudtl/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@napi-rs/canvas-icudtl-win32-x64", - "version": "0.0.3", - "os": ["win32"], - "cpu": ["x64"], - "files": ["icudtl.dat", "postinstall.js"], - "description": "External icu dat for Windows x64", - "keywords": [ - "napi-rs", - "NAPI", - "N-API", - "Rust", - "node-addon", - "node-addon-api", - "canvas", - "image", - "pdf", - "svg", - "skia", - "icu", - "unicode" - ], - "license": "MIT", - "publishConfig": { - "registry": "https://registry.npmjs.org/", - "access": "public" - }, - "repository": "https://github.com/Brooooooklyn/canvas.git", - "scripts": { - "postinstall": "node postinstall.js" - } -} diff --git a/npm/icudtl/postinstall.js b/npm/icudtl/postinstall.js deleted file mode 100644 index e27e4d69..00000000 --- a/npm/icudtl/postinstall.js +++ /dev/null @@ -1,11 +0,0 @@ -const { copyFile } = require('fs') -const { join } = require('path') - -const ICU_DAT = 'icudtl.dat' - -copyFile(join(__dirname, ICU_DAT), join(require.resolve('@napi-rs/canvas'), '..', ICU_DAT), (err) => { - if (err) { - console.error(err) - process.exit(1) - } -}) diff --git a/npm/win32-x64-msvc/package.json b/npm/win32-x64-msvc/package.json index 2fafdf62..fdd8c5f2 100644 --- a/npm/win32-x64-msvc/package.json +++ b/npm/win32-x64-msvc/package.json @@ -4,7 +4,7 @@ "os": ["win32"], "cpu": ["x64"], "main": "skia.win32-x64-msvc.node", - "files": ["skia.win32-x64-msvc.node"], + "files": ["skia.win32-x64-msvc.node", "icudtl.dat"], "description": "Canvas for Node.js with skia backend", "keywords": [ "napi-rs", diff --git a/scripts/release-skia-binary.js b/scripts/release-skia-binary.js index 9ec5448e..eb7a81a0 100644 --- a/scripts/release-skia-binary.js +++ b/scripts/release-skia-binary.js @@ -108,7 +108,7 @@ async function download() { } if (PLATFORM_NAME === 'win32') { await downloadIcu() - await fs.copyFile(join(__dirname, '..', ICU_DAT), join(__dirname, '..', 'npm', 'icudtl', ICU_DAT)) + await fs.copyFile(join(__dirname, '..', ICU_DAT), join(__dirname, '..', 'npm', 'win32-x64-msvc', ICU_DAT)) } }