Skip to content

Commit 47f649f

Browse files
committed
feat: add key to ci
1 parent 94225ca commit 47f649f

File tree

4 files changed

+72
-65
lines changed

4 files changed

+72
-65
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,57 @@ name: ci
33
on: [push]
44

55
jobs:
6-
compile:
7-
runs-on: ubuntu-latest
8-
9-
steps:
10-
- name: Checkout repo
11-
uses: actions/checkout@v3
12-
13-
- name: Set up node
14-
uses: actions/setup-node@v3
15-
16-
- name: Compile
17-
run: yarn && yarn build
18-
19-
test:
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
- name: Checkout repo
24-
uses: actions/checkout@v3
25-
26-
- name: Set up node
27-
uses: actions/setup-node@v3
28-
29-
- name: Compile
30-
run: yarn && yarn test
31-
32-
publish:
33-
needs: [ compile, test ]
34-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
35-
runs-on: ubuntu-latest
36-
steps:
37-
- name: Checkout repo
38-
uses: actions/checkout@v3
39-
- name: Set up node
40-
uses: actions/setup-node@v3
41-
- name: Install dependencies
42-
run: yarn install
43-
- name: Build
44-
run: yarn build
45-
46-
- name: Publish to npm
47-
run: |
48-
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
49-
if [[ ${GITHUB_REF} == *alpha* ]]; then
50-
npm publish --access public --tag alpha
51-
elif [[ ${GITHUB_REF} == *beta* ]]; then
52-
npm publish --access public --tag beta
53-
else
54-
npm publish --access public
55-
fi
56-
env:
57-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v3
12+
13+
- name: Set up node
14+
uses: actions/setup-node@v3
15+
16+
- name: Compile
17+
run: yarn && yarn build
18+
19+
test:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repo
24+
uses: actions/checkout@v3
25+
26+
- name: Set up node
27+
uses: actions/setup-node@v3
28+
29+
- name: Compile
30+
run: yarn && yarn test
31+
env:
32+
ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_API_KEY }}
33+
34+
publish:
35+
needs: [compile, test]
36+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout repo
40+
uses: actions/checkout@v3
41+
- name: Set up node
42+
uses: actions/setup-node@v3
43+
- name: Install dependencies
44+
run: yarn install
45+
- name: Build
46+
run: yarn build
47+
48+
- name: Publish to npm
49+
run: |
50+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
51+
if [[ ${GITHUB_REF} == *alpha* ]]; then
52+
npm publish --access public --tag alpha
53+
elif [[ ${GITHUB_REF} == *beta* ]]; then
54+
npm publish --access public --tag beta
55+
else
56+
npm publish --access public
57+
fi
58+
env:
59+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,12 @@ A request is deemed retriable when any of the following HTTP status codes is ret
115115
Use the `maxRetries` request option to configure this behavior.
116116

117117
```ts
118-
const response = await elevenlabs.voices.getAll({}, {
119-
maxRetries: 2 // Set the maximum number of retries
120-
});
118+
const response = await elevenlabs.voices.getAll(
119+
{},
120+
{
121+
maxRetries: 2, // Set the maximum number of retries
122+
}
123+
);
121124
```
122125

123126
## Timeouts
@@ -126,9 +129,12 @@ The SDK defaults to a 60 second timout. Use the `timeoutInSeconds` option to
126129
configure this behavior.
127130

128131
```ts
129-
const response = await elevenlabs.voices.getAll({}, {
130-
timeoutInSeconds: 30, // override timeout to 30s
131-
});
132+
const response = await elevenlabs.voices.getAll(
133+
{},
134+
{
135+
timeoutInSeconds: 30, // override timeout to 30s
136+
}
137+
);
132138
```
133139

134140
## Runtime compatiblity
@@ -144,7 +150,6 @@ The following runtimes are supported:
144150
- Deno v1.25+
145151
- Bun 1.0+
146152

147-
148153
## Elevenlabs Namespace
149154

150155
All of the ElevenLabs models are nested within the `ElevenLabs` namespace.

src/wrapper/play.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import commandExists from "command-exists";
22
import * as stream from "stream";
33
import { ElevenLabsError } from "../errors/ElevenLabsError";
4-
import { RUNTIME } from "../core/runtime/runtime"
4+
import { RUNTIME } from "../core/runtime/runtime";
55
import execa from "execa";
66

77
export async function play(audio: stream.Readable): Promise<void> {
88
if (RUNTIME.type !== "node") {
99
throw new ElevenLabsError({
10-
message: `This function is only supported in node environments. ${RUNTIME.type} is not supported`
11-
})
10+
message: `This function is only supported in node environments. ${RUNTIME.type} is not supported`,
11+
});
1212
}
1313
if (!commandExists("ffplay")) {
1414
throw new ElevenLabsError({

src/wrapper/stream.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import commandExists from "command-exists";
22
import * as nodeStream from "stream";
33
import { ElevenLabsError } from "../errors/ElevenLabsError";
4-
import { RUNTIME } from "../core/runtime/runtime"
4+
import { RUNTIME } from "../core/runtime/runtime";
55
import execa from "execa";
66

77
export async function stream(audio: nodeStream.Readable): Promise<void> {
88
if (RUNTIME.type !== "node") {
99
throw new ElevenLabsError({
10-
message: `This function is only supported in node environments. ${RUNTIME.type} is not supported`
11-
})
10+
message: `This function is only supported in node environments. ${RUNTIME.type} is not supported`,
11+
});
1212
}
1313
if (!commandExists("mpv")) {
1414
throw new ElevenLabsError({

0 commit comments

Comments
 (0)