Skip to content

Commit 3666f51

Browse files
chore: update SDK settings
1 parent 0e69d4d commit 3666f51

File tree

4 files changed

+49
-6
lines changed

4 files changed

+49
-6
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'ppl-ai/perplexity-node'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: stainless-api/trigger-release-please@v1
19+
id: release
20+
with:
21+
repo: ${{ github.event.repository.full_name }}
22+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
23+
24+
- name: Set up Node
25+
if: ${{ steps.release.outputs.releases_created }}
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
30+
- name: Install dependencies
31+
if: ${{ steps.release.outputs.releases_created }}
32+
run: |
33+
yarn install
34+
35+
- name: Publish to NPM
36+
if: ${{ steps.release.outputs.releases_created }}
37+
run: |
38+
bash ./bin/publish-npm
39+
env:
40+
NPM_TOKEN: ${{ secrets.PERPLEXITY_NPM_TOKEN || secrets.NPM_TOKEN }}
41+

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# This workflow is triggered when a GitHub release is created.
2-
# It can also be run manually to re-publish to NPM in case it failed for some reason.
3-
# You can run this workflow by navigating to https://www.github.com/ppl-ai/perplexity-node/actions/workflows/publish-npm.yml
1+
# This workflow publishes the package to NPM.
2+
# You can run this workflow manually by navigating to https://www.github.com/ppl-ai/perplexity-node/actions/workflows/publish-npm.yml
43
name: Publish NPM
54
on:
65
workflow_dispatch:
76

8-
release:
9-
types: [published]
10-
117
jobs:
128
publish:
139
name: publish

.github/workflows/release-doctor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
2122
NPM_TOKEN: ${{ secrets.PERPLEXITY_NPM_TOKEN || secrets.NPM_TOKEN }}
23+

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${STAINLESS_API_KEY}" ]; then
6+
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7+
fi
8+
59
if [ -z "${NPM_TOKEN}" ]; then
610
errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
711
fi

0 commit comments

Comments
 (0)