File tree 5 files changed +73
-12
lines changed 5 files changed +73
-12
lines changed Original file line number Diff line number Diff line change
1
+ name : Create releases
2
+ on :
3
+ schedule :
4
+ - cron : ' 0 5 * * *' # every day at 5am UTC
5
+ push :
6
+ branches :
7
+ - master
8
+
9
+ jobs :
10
+ release :
11
+ name : release
12
+ if : github.ref == 'refs/heads/master' && github.repository == 'openai/openai-node'
13
+ runs-on : ubuntu-latest
14
+ environment : publish
15
+
16
+ steps :
17
+ - uses : actions/checkout@v3
18
+
19
+ - uses : stainless-api/trigger-release-please@v1
20
+ id : release
21
+ with :
22
+ repo : ${{ github.event.repository.full_name }}
23
+ stainless-api-key : ${{ secrets.STAINLESS_API_KEY }}
24
+
25
+ - name : Generate a token
26
+ id : generate_token
27
+ uses : actions/create-github-app-token@v1
28
+ with :
29
+ app-id : ${{ secrets.APP_ID }}
30
+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
31
+ owner : ' openai'
32
+ repositories : ' openai-node,openai-deno-build'
33
+
34
+ - name : Set up Node
35
+ if : ${{ steps.release.outputs.releases_created }}
36
+ uses : actions/setup-node@v3
37
+ with :
38
+ node-version : ' 18'
39
+
40
+ - name : Set up Deno
41
+ if : ${{ steps.release.outputs.releases_created }}
42
+ uses : denoland/setup-deno@v1
43
+ with :
44
+ deno-version : v1.35.1
45
+
46
+ - name : Install dependencies
47
+ if : ${{ steps.release.outputs.releases_created }}
48
+ run : |
49
+ yarn install
50
+
51
+ - name : Publish to NPM
52
+ if : ${{ steps.release.outputs.releases_created }}
53
+ run : |
54
+ bash ./bin/publish-npm
55
+ env :
56
+ NPM_TOKEN : ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }}
57
+
58
+ - name : Publish to Deno
59
+ if : ${{ steps.release.outputs.releases_created }}
60
+ run : |
61
+ bash ./scripts/git-publish-deno.sh
62
+ env :
63
+ DENO_PUSH_REMOTE_URL : https://username:${{ steps.generate_token.outputs.token }}@github.com/openai/openai-deno-build.git
64
+ DENO_PUSH_BRANCH : main
Original file line number Diff line number Diff line change 1
- # This workflow is triggered when a GitHub release is created.
2
- # It can also be run manually to re-publish to Deno in case it failed for some reason.
3
- # You can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-deno.yml
1
+ # workflow for re-running publishing to Deno in case it fails for some reason
2
+ # you can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-deno.yml
4
3
name : Publish Deno
5
4
on :
6
5
workflow_dispatch :
7
6
8
- release :
9
- types : [published]
10
-
11
7
jobs :
12
8
publish :
13
9
name : publish
Original file line number Diff line number Diff line change 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/openai/openai-node/actions/workflows/publish-npm.yml
1
+ # workflow for re-running publishing to NPM in case it fails for some reason
2
+ # you can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-npm.yml
4
3
name : Publish NPM
5
4
on :
6
5
workflow_dispatch :
7
6
8
- release :
9
- types : [published]
10
-
11
7
jobs :
12
8
publish :
13
9
name : publish
Original file line number Diff line number Diff line change 19
19
run : |
20
20
bash ./bin/check-release-environment
21
21
env :
22
+ STAINLESS_API_KEY : ${{ secrets.STAINLESS_API_KEY }}
22
23
NPM_TOKEN : ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 2
2
3
3
errors=()
4
4
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
+
5
9
if [ -z " ${NPM_TOKEN} " ]; then
6
10
errors+=(" The OPENAI_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets" )
7
11
fi
You can’t perform that action at this time.
0 commit comments