diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0312165a..62224e1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,8 +12,6 @@ jobs: lint: name: lint runs-on: ubuntu-latest - - steps: - uses: actions/checkout@v4 @@ -31,8 +29,9 @@ jobs: build: name: build runs-on: ubuntu-latest - - + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -46,10 +45,24 @@ jobs: - name: Check build run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/orb-node' + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: github.repository == 'stainless-sdks/orb-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c2c361a6..072c8290 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.72.1" + ".": "4.72.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 512d4de9..c14141f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 4.72.2 (2025-04-14) + +Full Changelog: [v4.72.1...v4.72.2](https://github.com/orbcorp/orb-node/compare/v4.72.1...v4.72.2) + +### Bug Fixes + +* **client:** correctly reuse idempotency key ([a5b7cfe](https://github.com/orbcorp/orb-node/commit/a5b7cfe1d047eaedc243767e5b0b420e795fff88)) + + +### Chores + +* **internal:** reduce CI branch coverage ([f7db5ee](https://github.com/orbcorp/orb-node/commit/f7db5ee3dfea91cf4dd9aa1be7cea5e7f6ed7e6f)) +* **internal:** upload builds and expand CI branch coverage ([#597](https://github.com/orbcorp/orb-node/issues/597)) ([5d4c819](https://github.com/orbcorp/orb-node/commit/5d4c819853e4cc0c67016f5e3d1b8e2076165d2b)) + ## 4.72.1 (2025-04-08) Full Changelog: [v4.72.0...v4.72.1](https://github.com/orbcorp/orb-node/compare/v4.72.0...v4.72.1) diff --git a/package.json b/package.json index 1b83b715..a0f8e7e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "orb-billing", - "version": "4.72.1", + "version": "4.72.2", "description": "The official TypeScript library for the Orb API", "author": "Orb ", "types": "dist/index.d.ts", diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 00000000..ef8f9d6d --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/orb-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/core.ts b/src/core.ts index 05125d32..ef9b57bc 100644 --- a/src/core.ts +++ b/src/core.ts @@ -296,10 +296,10 @@ export abstract class APIClient { } buildRequest( - options: FinalRequestOptions, + inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { - options = { ...options }; + const options = { ...inputOptions }; const { method, path, query, headers: headers = {} } = options; const body = @@ -327,8 +327,8 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); diff --git a/src/version.ts b/src/version.ts index f456655d..08adaf44 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.72.1'; // x-release-please-version +export const VERSION = '4.72.2'; // x-release-please-version