Skip to content

Commit 6e2df3d

Browse files
authored
Merge pull request #516 from openai/dev/atty/manual-deno-workflow
[github] Add a manual workflow to publish openai-deno-build
2 parents 049ce6f + 4346ba6 commit 6e2df3d

File tree

3 files changed

+46
-11
lines changed

3 files changed

+46
-11
lines changed

.github/workflows/publish-deno.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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
3+
name: Publish Deno
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
environment: publish
12+
13+
steps:
14+
- name: Generate a token
15+
id: generate_token
16+
uses: actions/create-github-app-token@v1
17+
with:
18+
app-id: ${{ secrets.APP_ID }}
19+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
20+
owner: 'openai'
21+
repositories: 'openai-node,openai-deno-build'
22+
23+
- uses: actions/checkout@v3
24+
25+
- name: Set up Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '16'
29+
30+
- name: Set up Deno
31+
uses: denoland/setup-deno@v1
32+
with:
33+
deno-version: v1.x
34+
35+
- name: Install dependencies
36+
run: |
37+
yarn install
38+
39+
- name: Publish to Deno
40+
run: |
41+
bash ./scripts/git-publish-deno.sh
42+
env:
43+
DENO_PUSH_REMOTE_URL: https://username:${{ steps.generate_token.outputs.token }}@github.com/openai/openai-deno-build.git
44+
DENO_PUSH_BRANCH: main

.github/workflows/publish-npm.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
publish:
99
name: publish
1010
runs-on: ubuntu-latest
11+
environment: publish
1112

1213
steps:
1314
- uses: actions/checkout@v3
@@ -17,11 +18,6 @@ jobs:
1718
with:
1819
node-version: '16'
1920

20-
- name: Set up Deno
21-
uses: denoland/setup-deno@v1
22-
with:
23-
deno-version: v1.x
24-
2521
- name: Install dependencies
2622
run: |
2723
yarn install
@@ -31,8 +27,3 @@ jobs:
3127
bash ./bin/publish-npm
3228
env:
3329
NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }}
34-
35-
- name: Publish to Deno
36-
run: |
37-
bash ./scripts/git-publish-deno.sh
38-
env: {}

scripts/git-publish-deno.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -exuo pipefail
33

4-
# This script pushes the contents of the `deno`` directory to the `deno` branch,
4+
# This script pushes the contents of the `deno` directory to the `deno` branch,
55
# and creates a `vx.x.x-deno` tag, so that Deno users can
66
# import OpenAI from "https://raw.githubusercontent.com/openai/openai-node/vx.x.x-deno/mod.ts"
77

0 commit comments

Comments
 (0)