-
Notifications
You must be signed in to change notification settings - Fork 869
64 lines (55 loc) · 1.82 KB
/
create-releases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Create releases
on:
schedule:
- cron: '0 5 * * *' # every day at 5am UTC
push:
branches:
- master
jobs:
release:
name: release
if: github.ref == 'refs/heads/master' && github.repository == 'openai/openai-node'
runs-on: ubuntu-latest
environment: publish
steps:
- uses: actions/checkout@v3
- uses: stainless-api/trigger-release-please@v1
id: release
with:
repo: ${{ github.event.repository.full_name }}
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: 'openai'
repositories: 'openai-node,openai-deno-build'
- name: Set up Node
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Set up Deno
if: ${{ steps.release.outputs.releases_created }}
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install dependencies
if: ${{ steps.release.outputs.releases_created }}
run: |
yarn install
- name: Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
run: |
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }}
- name: Publish to Deno
if: ${{ steps.release.outputs.releases_created }}
run: |
bash ./scripts/git-publish-deno.sh
env:
DENO_PUSH_REMOTE_URL: https://username:${{ steps.generate_token.outputs.token }}@github.com/openai/openai-deno-build.git
DENO_PUSH_BRANCH: main