Merge pull request #331 from openai/release-please--branches--master-… #14
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
name: Create releases | |
on: | |
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: Set up Node | |
if: ${{ steps.release.outputs.releases_created }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- 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 }} |