Skip to content

Commit 2e7752c

Browse files
author
Andrei Bratu
committed
Added API keys to CI action
1 parent 71f6416 commit 2e7752c

File tree

1 file changed

+56
-52
lines changed

1 file changed

+56
-52
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,59 @@ 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+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
33+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
34+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
35+
36+
publish:
37+
needs: [compile, test]
38+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Checkout repo
42+
uses: actions/checkout@v3
43+
- name: Set up node
44+
uses: actions/setup-node@v3
45+
- name: Install dependencies
46+
run: yarn install
47+
- name: Build
48+
run: yarn build
49+
50+
- name: Publish to npm
51+
run: |
52+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
53+
if [[ ${GITHUB_REF} == *alpha* ]]; then
54+
npm publish --access public --tag alpha
55+
elif [[ ${GITHUB_REF} == *beta* ]]; then
56+
npm publish --access public --tag beta
57+
else
58+
npm publish --access public
59+
fi
60+
env:
61+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)