diff --git a/.github/workflows/release-spruce-dev.yml b/.github/workflows/release-spruce-dev.yml index c0482bcc..3dda59f3 100644 --- a/.github/workflows/release-spruce-dev.yml +++ b/.github/workflows/release-spruce-dev.yml @@ -37,7 +37,7 @@ jobs: jq --arg newVersion "$devVersion" '.version = $newVersion' package.json > package.tmp && mv package.tmp package.json jq --arg newVersion "$devVersion" '.version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json jq --arg newVersion "$devVersion" '.packages[""].version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json - jq --null-input --arg version "$devVersion" '{"name": "@pinecone-database/pinecone", "version": $version}' > src/version.json + jq --null-input --arg version "$devVersion" --arg release "@spruce" '{"name": "@pinecone-database/pinecone", "version": $version, "release": $release}' > src/version.json - name: 'Publish to npm' run: npm publish --tag spruceDev diff --git a/.github/workflows/release-spruce.yml b/.github/workflows/release-spruce.yml index 52c38f54..125cae12 100644 --- a/.github/workflows/release-spruce.yml +++ b/.github/workflows/release-spruce.yml @@ -25,7 +25,7 @@ jobs: jq --arg newVersion "$devVersion" '.version = $newVersion' package.json > package.tmp && mv package.tmp package.json jq --arg newVersion "$devVersion" '.version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json jq --arg newVersion "$devVersion" '.packages[""].version = $newVersion' package-lock.json > package-lock.tmp && mv package-lock.tmp package-lock.json - jq --null-input --arg version "$devVersion" '{"name": "@pinecone-database/pinecone", "version": $version}' > src/version.json + jq --null-input --arg version "$devVersion" --arg release "@spruce" '{"name": "@pinecone-database/pinecone", "version": $version, "release": $release}' > src/version.json - name: 'Publish to npm' run: npm publish --tag spruce diff --git a/src/utils/user-agent.ts b/src/utils/user-agent.ts index 4e291263..ab1f4a30 100644 --- a/src/utils/user-agent.ts +++ b/src/utils/user-agent.ts @@ -10,6 +10,11 @@ export const buildUserAgent = (isLegacy: boolean) => { 'lang=typescript', ]; + // If there's a release in packageInfo, append to the user agent + if (packageInfo.release && packageInfo.release !== '') { + userAgentParts.push(`release=${packageInfo.release}`); + } + if (isEdge()) { userAgentParts.push('Edge Runtime'); } diff --git a/src/version.json b/src/version.json index adc962b9..f1bba8e8 100644 --- a/src/version.json +++ b/src/version.json @@ -1,4 +1,5 @@ { "name": "@pinecone-database/pinecone", - "version": "1.1.2" + "version": "1.1.2", + "release": "" }