Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Apr 7, 2022
1 parent 34f16c2 commit 4468d2b
Show file tree
Hide file tree
Showing 25 changed files with 96 additions and 610 deletions.
391 changes: 27 additions & 364 deletions .github/workflows/CI.yml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@speechifyinc:registry=https://npm.pkg.github.com
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ version = "0.0.0"
crate-type = ["cdylib"]

[dependencies]
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
# https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.2.0", default-features = false, features = ["napi8", "async"] }
napi-derive = "2.2.0"
libc = "0.2"
cfile = "0.5.1"
futures = "0.3"
espeakng-sys = "0.1.0"
espeakng-sys = "0.1.1"
lazy_static = "1.4.0"

[build-dependencies]
Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:16

RUN apt-get update && apt-get -y install gcc libespeak-ng-dev libclang-dev

USER node

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
ENV PATH="/home/node/.cargo/bin:$PATH"
78 changes: 39 additions & 39 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ switch (platform) {
case 'android':
switch (arch) {
case 'arm64':
localFileExisted = existsSync(join(__dirname, 'espeak-rs.android-arm64.node'))
localFileExisted = existsSync(join(__dirname, '@speechifyinc/espeak-rs.android-arm64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.android-arm64.node')
nativeBinding = require('./@speechifyinc/espeak-rs.android-arm64.node')
} else {
nativeBinding = require('espeak-rs-android-arm64')
nativeBinding = require('@speechifyinc/espeak-rs-android-arm64')
}
} catch (e) {
loadError = e
}
break
case 'arm':
localFileExisted = existsSync(join(__dirname, 'espeak-rs.android-arm-eabi.node'))
localFileExisted = existsSync(join(__dirname, '@speechifyinc/espeak-rs.android-arm-eabi.node'))
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.android-arm-eabi.node')
nativeBinding = require('./@speechifyinc/espeak-rs.android-arm-eabi.node')
} else {
nativeBinding = require('espeak-rs-android-arm-eabi')
nativeBinding = require('@speechifyinc/espeak-rs-android-arm-eabi')
}
} catch (e) {
loadError = e
Expand All @@ -56,41 +56,41 @@ switch (platform) {
switch (arch) {
case 'x64':
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.win32-x64-msvc.node')
join(__dirname, '@speechifyinc/espeak-rs.win32-x64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.win32-x64-msvc.node')
nativeBinding = require('./@speechifyinc/espeak-rs.win32-x64-msvc.node')
} else {
nativeBinding = require('espeak-rs-win32-x64-msvc')
nativeBinding = require('@speechifyinc/espeak-rs-win32-x64-msvc')
}
} catch (e) {
loadError = e
}
break
case 'ia32':
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.win32-ia32-msvc.node')
join(__dirname, '@speechifyinc/espeak-rs.win32-ia32-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.win32-ia32-msvc.node')
nativeBinding = require('./@speechifyinc/espeak-rs.win32-ia32-msvc.node')
} else {
nativeBinding = require('espeak-rs-win32-ia32-msvc')
nativeBinding = require('@speechifyinc/espeak-rs-win32-ia32-msvc')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.win32-arm64-msvc.node')
join(__dirname, '@speechifyinc/espeak-rs.win32-arm64-msvc.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.win32-arm64-msvc.node')
nativeBinding = require('./@speechifyinc/espeak-rs.win32-arm64-msvc.node')
} else {
nativeBinding = require('espeak-rs-win32-arm64-msvc')
nativeBinding = require('@speechifyinc/espeak-rs-win32-arm64-msvc')
}
} catch (e) {
loadError = e
Expand All @@ -103,26 +103,26 @@ switch (platform) {
case 'darwin':
switch (arch) {
case 'x64':
localFileExisted = existsSync(join(__dirname, 'espeak-rs.darwin-x64.node'))
localFileExisted = existsSync(join(__dirname, '@speechifyinc/espeak-rs.darwin-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.darwin-x64.node')
nativeBinding = require('./@speechifyinc/espeak-rs.darwin-x64.node')
} else {
nativeBinding = require('espeak-rs-darwin-x64')
nativeBinding = require('@speechifyinc/espeak-rs-darwin-x64')
}
} catch (e) {
loadError = e
}
break
case 'arm64':
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.darwin-arm64.node')
join(__dirname, '@speechifyinc/espeak-rs.darwin-arm64.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.darwin-arm64.node')
nativeBinding = require('./@speechifyinc/espeak-rs.darwin-arm64.node')
} else {
nativeBinding = require('espeak-rs-darwin-arm64')
nativeBinding = require('@speechifyinc/espeak-rs-darwin-arm64')
}
} catch (e) {
loadError = e
Expand All @@ -136,12 +136,12 @@ switch (platform) {
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'espeak-rs.freebsd-x64.node'))
localFileExisted = existsSync(join(__dirname, '@speechifyinc/espeak-rs.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.freebsd-x64.node')
nativeBinding = require('./@speechifyinc/espeak-rs.freebsd-x64.node')
} else {
nativeBinding = require('espeak-rs-freebsd-x64')
nativeBinding = require('@speechifyinc/espeak-rs-freebsd-x64')
}
} catch (e) {
loadError = e
Expand All @@ -152,26 +152,26 @@ switch (platform) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.linux-x64-musl.node')
join(__dirname, '@speechifyinc/espeak-rs.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.linux-x64-musl.node')
nativeBinding = require('./@speechifyinc/espeak-rs.linux-x64-musl.node')
} else {
nativeBinding = require('espeak-rs-linux-x64-musl')
nativeBinding = require('@speechifyinc/espeak-rs-linux-x64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.linux-x64-gnu.node')
join(__dirname, '@speechifyinc/espeak-rs.linux-x64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.linux-x64-gnu.node')
nativeBinding = require('./@speechifyinc/espeak-rs.linux-x64-gnu.node')
} else {
nativeBinding = require('espeak-rs-linux-x64-gnu')
nativeBinding = require('@speechifyinc/espeak-rs-linux-x64-gnu')
}
} catch (e) {
loadError = e
Expand All @@ -181,26 +181,26 @@ switch (platform) {
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.linux-arm64-musl.node')
join(__dirname, '@speechifyinc/espeak-rs.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.linux-arm64-musl.node')
nativeBinding = require('./@speechifyinc/espeak-rs.linux-arm64-musl.node')
} else {
nativeBinding = require('espeak-rs-linux-arm64-musl')
nativeBinding = require('@speechifyinc/espeak-rs-linux-arm64-musl')
}
} catch (e) {
loadError = e
}
} else {
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.linux-arm64-gnu.node')
join(__dirname, '@speechifyinc/espeak-rs.linux-arm64-gnu.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.linux-arm64-gnu.node')
nativeBinding = require('./@speechifyinc/espeak-rs.linux-arm64-gnu.node')
} else {
nativeBinding = require('espeak-rs-linux-arm64-gnu')
nativeBinding = require('@speechifyinc/espeak-rs-linux-arm64-gnu')
}
} catch (e) {
loadError = e
Expand All @@ -209,13 +209,13 @@ switch (platform) {
break
case 'arm':
localFileExisted = existsSync(
join(__dirname, 'espeak-rs.linux-arm-gnueabihf.node')
join(__dirname, '@speechifyinc/espeak-rs.linux-arm-gnueabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./espeak-rs.linux-arm-gnueabihf.node')
nativeBinding = require('./@speechifyinc/espeak-rs.linux-arm-gnueabihf.node')
} else {
nativeBinding = require('espeak-rs-linux-arm-gnueabihf')
nativeBinding = require('@speechifyinc/espeak-rs-linux-arm-gnueabihf')
}
} catch (e) {
loadError = e
Expand Down
3 changes: 0 additions & 3 deletions npm/darwin-arm64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/darwin-arm64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/darwin-x64/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/darwin-x64/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-arm-gnueabihf/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions npm/linux-arm-gnueabihf/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-arm64-gnu/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions npm/linux-arm64-gnu/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions npm/linux-arm64-musl/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions npm/linux-arm64-musl/package.json

This file was deleted.

4 changes: 2 additions & 2 deletions npm/linux-x64-gnu/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# `espeak-rs-linux-x64-gnu`
# `@speechifyinc/espeak-rs-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `espeak-rs`
This is the **x86_64-unknown-linux-gnu** binary for `@speechifyinc/espeak-rs`
7 changes: 5 additions & 2 deletions npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "espeak-rs-linux-x64-gnu",
"name": "@speechifyinc/espeak-rs-linux-x64-gnu",
"version": "0.0.1",
"os": [
"linux"
Expand All @@ -13,7 +13,10 @@
],
"license": "MIT",
"engines": {
"node": ">= 10"
"node": ">= 16"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"libc": [
"glibc"
Expand Down
3 changes: 0 additions & 3 deletions npm/linux-x64-musl/README.md

This file was deleted.

Loading

0 comments on commit 4468d2b

Please sign in to comment.