From ae553245a799725722002e505c86f8a890e7ae53 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:52:02 +0000 Subject: [PATCH] chore: go live (#2) --- .github/workflows/create-releases.yml | 40 ------------------- .../handle-release-pr-title-edit.yml | 25 ------------ .github/workflows/publish-npm.yml | 8 +++- .github/workflows/release-doctor.yml | 3 +- CONTRIBUTING.md | 6 +-- README.md | 6 +-- bin/check-release-environment | 4 -- package.json | 2 +- src/_shims/index-deno.ts | 2 +- src/_shims/web-runtime.ts | 2 +- 10 files changed, 16 insertions(+), 82 deletions(-) delete mode 100644 .github/workflows/create-releases.yml delete mode 100644 .github/workflows/handle-release-pr-title-edit.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 65a35c6..0000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'sachnk/studio-sdk-node' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - 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: '18' - - - 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.STUDIO_SDK_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/.github/workflows/handle-release-pr-title-edit.yml b/.github/workflows/handle-release-pr-title-edit.yml deleted file mode 100644 index 664fabe..0000000 --- a/.github/workflows/handle-release-pr-title-edit.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Handle release PR title edits -on: - pull_request: - types: - - edited - - unlabeled - -jobs: - update_pr_content: - name: Update pull request content - if: | - ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || - (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) && - startsWith(github.event.pull_request.head.ref, 'release-please--') && - github.event.pull_request.state == 'open' && - github.event.sender.login != 'stainless-bot' && - github.event.sender.login != 'stainless-app' && - github.repository == 'sachnk/studio-sdk-node' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: stainless-api/trigger-release-please@v1 - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index c4f4984..31a7f2d 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,9 +1,13 @@ -# workflow for re-running publishing to NPM in case it fails for some reason -# you can run this workflow by navigating to https://www.github.com/sachnk/studio-sdk-node/actions/workflows/publish-npm.yml +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to NPM in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/clear-street/studio-sdk-node/actions/workflows/publish-npm.yml name: Publish NPM on: workflow_dispatch: + release: + types: [published] + jobs: publish: name: publish diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 9ce3234..ca607e0 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -7,7 +7,7 @@ jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'sachnk/studio-sdk-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'clear-street/studio-sdk-node' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 @@ -16,5 +16,4 @@ jobs: run: | bash ./bin/check-release-environment env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} NPM_TOKEN: ${{ secrets.STUDIO_SDK_NPM_TOKEN || secrets.NPM_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdf815d..0f36e0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,14 +42,14 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -npm install git+ssh://git@github.com:sachnk/studio-sdk-node.git +npm install git+ssh://git@github.com:clear-street/studio-sdk-node.git ``` Alternatively, to link a local copy of the repo: ```bash # Clone -git clone https://www.github.com/sachnk/studio-sdk-node +git clone https://www.github.com/clear-street/studio-sdk-node cd studio-sdk-node # With yarn @@ -99,7 +99,7 @@ the changes aren't made through the automated pipeline, you may want to make rel ### Publish with a GitHub workflow -You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/sachnk/studio-sdk-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. +You can release to package managers by using [the `Publish NPM` GitHub action](https://www.github.com/clear-street/studio-sdk-node/actions/workflows/publish-npm.yml). This requires a setup organization or repository secret to be set up. ### Publish manually diff --git a/README.md b/README.md index ec6ba4c..ac2934e 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainlessapi.com/). ## Installation ```sh -npm install git+ssh://git@github.com:sachnk/studio-sdk-node.git +npm install git+ssh://git@github.com:clear-street/studio-sdk-node.git ``` > [!NOTE] @@ -214,7 +214,7 @@ import StudioSDK from 'studio-sdk'; ``` To do the inverse, add `import "studio-sdk/shims/node"` (which does import polyfills). -This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/sachnk/studio-sdk-node/tree/main/src/_shims#readme)). +This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/clear-street/studio-sdk-node/tree/main/src/_shims#readme)). ### Logging and middleware @@ -270,7 +270,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/sachnk/studio-sdk-node/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/clear-street/studio-sdk-node/issues) with questions, bugs, or suggestions. ## Requirements diff --git a/bin/check-release-environment b/bin/check-release-environment index 08601ac..ad75438 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,10 +3,6 @@ warnings=() errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${NPM_TOKEN}" ]; then warnings+=("The STUDIO_SDK_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi diff --git a/package.json b/package.json index 197ba2c..eb83e63 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", - "repository": "github:sachnk/studio-sdk-node", + "repository": "github:clear-street/studio-sdk-node", "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index 04cf548..1e475b2 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -79,7 +79,7 @@ export function getDefaultAgent(url: string) { } export function fileFromPath() { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/sachnk/studio-sdk-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/clear-street/studio-sdk-node#file-uploads', ); } diff --git a/src/_shims/web-runtime.ts b/src/_shims/web-runtime.ts index 8a145c7..f406759 100644 --- a/src/_shims/web-runtime.ts +++ b/src/_shims/web-runtime.ts @@ -95,7 +95,7 @@ export function getRuntime({ manuallyImported }: { manuallyImported?: boolean } getDefaultAgent: (url: string) => undefined, fileFromPath: () => { throw new Error( - 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/sachnk/studio-sdk-node#file-uploads', + 'The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/clear-street/studio-sdk-node#file-uploads', ); }, isFsReadStream: (value: any) => false,