-
Notifications
You must be signed in to change notification settings - Fork 883
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): revert "move github release logic to github app" (#680)
- Loading branch information
1 parent
3e0299b
commit 8b4009a
Showing
5 changed files
with
73 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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.35.1 | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters