Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[github] Add a manual workflow to publish openai-deno-build #516

Merged
merged 2 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/publish-deno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# workflow for re-running publishing to Deno in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/openai/openai-node/actions/workflows/publish-deno.yml
name: Publish Deno
on:
workflow_dispatch:

jobs:
publish:
name: publish
runs-on: ubuntu-latest
environment: publish

steps:
- 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'

- uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install dependencies
run: |
yarn install

- name: Publish to Deno
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
11 changes: 1 addition & 10 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
publish:
name: publish
runs-on: ubuntu-latest
environment: publish

steps:
- uses: actions/checkout@v3
Expand All @@ -17,11 +18,6 @@ jobs:
with:
node-version: '16'

- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Install dependencies
run: |
yarn install
Expand All @@ -31,8 +27,3 @@ jobs:
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.OPENAI_NPM_TOKEN || secrets.NPM_TOKEN }}

- name: Publish to Deno
run: |
bash ./scripts/git-publish-deno.sh
env: {}
2 changes: 1 addition & 1 deletion scripts/git-publish-deno.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -exuo pipefail

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

Expand Down