diff --git a/.github/workflows/release-cli.yml b/.github/workflows/_build_release_cli.yml similarity index 87% rename from .github/workflows/release-cli.yml rename to .github/workflows/_build_release_cli.yml index 6f0f226f604..d0fbfe166a2 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/_build_release_cli.yml @@ -3,12 +3,15 @@ name: Release CLI on: workflow_dispatch: inputs: - release_name: + version: description: "Release name to use (e.g. cli-1.2.3) when dispatching manually" required: false - push: - tags: - - 'cli_release_[0-9]*.[0-9]*.[0-9]*' + workflow_call: + inputs: + version: + description: "Version to publish" + required: true + type: string jobs: build-linux: @@ -139,20 +142,12 @@ jobs: - name: Determine release info id: release_info run: | - if [ "${GITHUB_EVENT_NAME}" = "push" ]; then - # The tag is available as refs/tags/cli_release_a.b.c. - TAG=${GITHUB_REF#refs/tags/} - VERSION=${TAG#cli_release_} - echo "release_name=cli-${VERSION}" >> $GITHUB_OUTPUT - echo "tag_name=${TAG}" >> $GITHUB_OUTPUT - else - if [ -z "${{ github.event.inputs.release_name }}" ]; then - echo "::error::Manual dispatch requires a release_name input." - exit 1 - fi - echo "release_name=${{ github.event.inputs.release_name }}" >> $GITHUB_OUTPUT - echo "tag_name=${{ github.event.inputs.release_name }}" >> $GITHUB_OUTPUT + if [ -z "${{ github.event.inputs.release_name }}" ]; then + echo "::error::Manual dispatch requires a release_name input." + exit 1 fi + echo "release_name=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT + echo "tag_name=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT - name: Create GitHub Release id: create_release @@ -161,7 +156,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.release_info.outputs.tag_name }} - release_name: ${{ steps.release_info.outputs.release_name }} + release_name: ${{ steps.release_info.outputs.version }} body: "CLI release." draft: false prerelease: false diff --git a/.github/workflows/release-chromadb-all.yml b/.github/workflows/release-chromadb-all.yml new file mode 100644 index 00000000000..531fdb1e287 --- /dev/null +++ b/.github/workflows/release-chromadb-all.yml @@ -0,0 +1,323 @@ +name: 📦 Release CLI, Python, and JS clients + +on: + push: + tags: + - "cli_*_python_*_js_*" + +jobs: + check-tag: + runs-on: blacksmith-4vcpu-ubuntu-2404 + outputs: + tag_matches: ${{ steps.check-tag.outputs.tag_matches }} + cli_version: ${{ steps.check-tag.outputs.cli_version }} + python_version: ${{ steps.check-tag.outputs.python_version }} + js_version: ${{ steps.check-tag.outputs.js_version }} + steps: + - name: Check Tag + id: check-tag + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/cli_[0-9]+\.[0-9]+\.[0-9]+_python_[0-9]+\.[0-9]+\.[0-9]+_js_[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "tag_matches=true" >> $GITHUB_OUTPUT + # Extract versions from cli_X.Y.Z_python_A.B.C_js_D.E.F format + TAG=$(echo "${{ github.event.ref }}" | sed 's/refs\/tags\///') + CLI_VERSION=$(echo "$TAG" | sed -E 's/^cli_([0-9]+\.[0-9]+\.[0-9]+)_python_[0-9]+\.[0-9]+\.[0-9]+_js_[0-9]+\.[0-9]+\.[0-9]+$/\1/') + PYTHON_VERSION=$(echo "$TAG" | sed -E 's/^cli_[0-9]+\.[0-9]+\.[0-9]+_python_([0-9]+\.[0-9]+\.[0-9]+)_js_[0-9]+\.[0-9]+\.[0-9]+$/\1/') + JS_VERSION=$(echo "$TAG" | sed -E 's/^cli_[0-9]+\.[0-9]+\.[0-9]+_python_[0-9]+\.[0-9]+\.[0-9]+_js_([0-9]+\.[0-9]+\.[0-9]+)$/\1/') + echo "cli_version=$CLI_VERSION" >> $GITHUB_OUTPUT + echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT + echo "js_version=$JS_VERSION" >> $GITHUB_OUTPUT + else + echo "Tag does not match the release tag pattern (cli_X.Y.Z_python_A.B.C_js_D.E.F), exiting workflow" + echo "tag_matches=false" >> $GITHUB_OUTPUT + fi + + get-python-version: + runs-on: blacksmith-4vcpu-ubuntu-2404 + needs: [check-tag] + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + - name: Install setuptools_scm + run: python -m pip install setuptools_scm + - name: Get Release Version + id: version + run: echo "version=$(python -m setuptools_scm)" >> $GITHUB_OUTPUT + - name: Validate Python version matches tag + if: ${{ needs.check-tag.outputs.tag_matches == 'true' }} + run: | + SETUPTOOLS_VERSION="${{ steps.version.outputs.version }}" + TAG_VERSION="${{ needs.check-tag.outputs.python_version }}" + if [ "$SETUPTOOLS_VERSION" != "$TAG_VERSION" ]; then + echo "ERROR: setuptools_scm version ($SETUPTOOLS_VERSION) does not match tag python version ($TAG_VERSION)" + exit 1 + else + echo "✓ setuptools_scm version matches tag python version: $TAG_VERSION" + fi + + python-tests-linux: + uses: ./.github/workflows/_python-tests.yml + secrets: inherit + with: + python_versions: '["3.9", "3.10", "3.11", "3.12"]' + property_testing_preset: 'normal' + + python-tests-windows: + uses: ./.github/workflows/_python-tests.yml + secrets: inherit + with: + # we only run windows tests on 3.12 because windows runners are expensive + # and we usually don't see failures that are isolated to a specific version + python_versions: '["3.12"]' + property_testing_preset: 'normal' + runner: '8core-32gb-windows-latest' + + javascript-client-tests: + name: JavaScript client tests + uses: ./.github/workflows/_javascript-client-tests.yml + + rust-tests: + name: Rust tests + uses: ./.github/workflows/_rust-tests.yml + secrets: inherit + + go-tests: + name: Go tests + uses: ./.github/workflows/_go-tests.yml + secrets: inherit + + release-cli: + name: Release CLI + needs: + - check-tag + - get-python-version + - python-tests-linux + - python-tests-windows + - javascript-client-tests + - rust-tests + - go-tests + uses: ./.github/workflows/_build_release_cli.yml + secrets: inherit + with: + version: cli-${{ needs.check-tag.outputs.cli_version }} + + release-js-bindings: + name: Release JS Bindings + needs: + - check-tag + - get-python-version + - python-tests-linux + - python-tests-windows + - javascript-client-tests + - rust-tests + - go-tests + uses: ./.github/workflows/_build_js_bindings.yml + secrets: inherit + + release-js-client: + name: Release JS Client + needs: + - check-tag + - release-js-bindings + uses: ./.github/workflows/release-javascript-client.yml + secrets: inherit + with: + tag: js_release_${{ needs.check-tag.outputs.js_version }} + + release-docker: + name: Publish to DockerHub and GHCR + needs: + - check-tag + - get-python-version + - python-tests-linux + - python-tests-windows + - javascript-client-tests + - rust-tests + - go-tests + uses: ./.github/workflows/_build_release_container.yml + secrets: inherit + with: + tag: ${{ needs.get-python-version.outputs.version }} + tag_as_latest: ${{ needs.check-tag.outputs.tag_matches == 'true' }} + push: true + + release-pypi: + name: Publish to PyPI + needs: + - check-tag + - get-python-version + - python-tests-linux + - python-tests-windows + - javascript-client-tests + - rust-tests + - go-tests + uses: ./.github/workflows/_build_release_pypi.yml + secrets: inherit + with: + publish_to_test_pypi: true + publish_to_pypi: ${{ needs.check-tag.outputs.tag_matches == 'true' }} + version: ${{ needs.get-python-version.outputs.version }} + + release-thin-pypi: + name: Publish thin client to PyPI + runs-on: blacksmith-4vcpu-ubuntu-2404 + needs: + - check-tag + - python-tests-linux + - python-tests-windows + - javascript-client-tests + - rust-tests + - go-tests + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: ./.github/actions/python + with: + python-version: '3.12' + - name: Build Client + run: ./clients/python/build_python_thin_client.sh + - name: Test Client Package + run: bin/test-package/test-thin-client-package.sh dist/*.tar.gz + - name: Install setuptools_scm + run: python -m pip install setuptools_scm + - name: Publish to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_PYTHON_CLIENT_PUBLISH_KEY }} + repository-url: https://test.pypi.org/legacy/ + verbose: 'true' + - name: Publish to PyPI + if: ${{ needs.check-tag.outputs.tag_matches == 'true' }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_PYTHON_CLIENT_PUBLISH_KEY }} + verbose: 'true' + + release-github: + name: Make GitHub release + runs-on: blacksmith-4vcpu-ubuntu-2404 + needs: + - check-tag + - get-python-version + - release-docker + - release-pypi + - release-thin-pypi + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Download artifact + uses: actions/download-artifact@v4 + with: + pattern: wheels-* + path: dist + - name: Get current date + id: builddate + run: echo "builddate=$(date +'%Y-%m-%dT%H:%M')" >> $GITHUB_OUTPUT + - name: Release Tagged Version + uses: ncipollo/release-action@v1.14.0 + if: ${{ needs.check-tag.outputs.tag_matches == 'true' }} + with: + body: | + Version: `${{needs.get-python-version.outputs.version}}` + Git ref: `${{github.ref}}` + Build Date: `${{steps.builddate.outputs.builddate}}` + PIP Package: `chroma-${{needs.get-python-version.outputs.version}}.tar.gz` + Github Container Registry Image: `${{ env.GHCR_IMAGE_NAME }}:${{ needs.get-python-version.outputs.version }}` + DockerHub Image: `${{ env.DOCKERHUB_IMAGE_NAME }}:${{ needs.get-python-version.outputs.version }}` + artifacts: "dist/*" + prerelease: false + makeLatest: true + generateReleaseNotes: true + - name: Update Tag + uses: richardsimko/update-tag@v1.0.5 + if: ${{ needs.check-tag.outputs.tag_matches != 'true' }} + with: + tag_name: latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release Latest + uses: ncipollo/release-action@v1.14.0 + if: ${{ needs.check-tag.outputs.tag_matches != 'true' }} + with: + tag: "latest" + name: "Latest" + body: | + Version: `${{needs.get-python-version.outputs.version}}` + Git ref: `${{github.ref}}` + Build Date: `${{steps.builddate.outputs.builddate}}` + PIP Package: `chroma-${{needs.get-python-version.outputs.version}}.tar.gz` + Github Container Registry Image: `${{ env.GHCR_IMAGE_NAME }}:${{ needs.get-python-version.outputs.version }}` + DockerHub Image: `${{ env.DOCKERHUB_IMAGE_NAME }}:${{ needs.get-python-version.outputs.version }}` + artifacts: "dist/*" + allowUpdates: true + removeArtifacts: true + prerelease: true + + deploy-staging: + name: Deploy to staging + # depends on release-github because it updates the tag to latest, which is what will get deployed + needs: + - release-github + uses: ./.github/workflows/_deploy.yml + secrets: inherit + + release-docs: + name: Deploy docs to Vercel + runs-on: blacksmith-4vcpu-ubuntu-2404 + needs: + - check-tag + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" + - name: Install vercel + run: npm install -g vercel + - name: Deploy + run: vercel deploy --token ${{ secrets.VERCEL_TOKEN }} ${{ needs.check-tag.outputs.tag_matches == 'true' && '--prod' || '' }} + env: + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }} + + notify-slack-on-failure: + name: Notify Slack on ChromaDB Release Failure + if: failure() + needs: + - release-docker + - release-pypi + - release-thin-pypi + - release-github + - deploy-staging + - release-docs + runs-on: blacksmith-2vcpu-ubuntu-2404 + steps: + - name: Notify Slack + uses: slackapi/slack-github-action@v2.0.0 + with: + token: ${{ secrets.SLACK_BOT_TOKEN }} + method: chat.postMessage + payload: | + channel: ${{ secrets.SLACK_CHANNEL_ID }} + text: | + :x: *ChromaDB release failure!* + *Workflow:* ${{ github.workflow }} + *Run:* + *Ref:* + *Author:* ${{ github.actor }} diff --git a/.github/workflows/release-dev-javascript-client.yml b/.github/workflows/release-dev-javascript-client.yml index 4ad96d0b839..a331121c88d 100644 --- a/.github/workflows/release-dev-javascript-client.yml +++ b/.github/workflows/release-dev-javascript-client.yml @@ -47,15 +47,15 @@ jobs: check-latest: false token: ${{ secrets.GITHUB_TOKEN }} cache: 'pnpm' - cache-dependency-path: 'clients/js/pnpm-lock.yaml' + cache-dependency-path: 'clients/new-js/packages/chromadb/pnpm-lock.yaml' - name: Install dependencies run: pnpm install --no-frozen-lockfile - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Build packages run: pnpm build - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Generate Dev Version id: dev-version @@ -66,41 +66,35 @@ jobs: DEV_TAG="dev.${COMMIT_SHA}-${GITHUB_RUN_ID}" echo "DEV_TAG=${DEV_TAG}" >> "$GITHUB_ENV" - # Update each package's version with dev tag - for PKG_DIR in packages/chromadb packages/chromadb-client; do - PKG_PATH="./${PKG_DIR}/package.json" - # Get current version - CURRENT_VERSION=$(node -p "require('${PKG_PATH}').version") - # Create full version with dev tag - BASE_VERSION=$(echo $CURRENT_VERSION | cut -f1,2 -d.) - PATCH_VERSION=$(echo $CURRENT_VERSION | cut -f3 -d.) - # bump patch version - NEW_PATCH_VERSION=$((PATCH_VERSION + 1)) - NEW_VERSION="${BASE_VERSION}.${NEW_PATCH_VERSION}-${DEV_TAG}" + # Update package version with dev tag + PKG_PATH="./package.json" + # Get current version + CURRENT_VERSION=$(node -p "require('${PKG_PATH}').version") + # Create full version with dev tag + BASE_VERSION=$(echo $CURRENT_VERSION | cut -f1,2 -d.) + PATCH_VERSION=$(echo $CURRENT_VERSION | cut -f3 -d.) + # bump patch version + NEW_PATCH_VERSION=$((PATCH_VERSION + 1)) + NEW_VERSION="${BASE_VERSION}.${NEW_PATCH_VERSION}-${DEV_TAG}" - # Update package.json with new version - jq --arg version "$NEW_VERSION" '.version = $version' $PKG_PATH > tmp.$$.json && mv tmp.$$.json $PKG_PATH - echo "Updated ${PKG_DIR} to version ${NEW_VERSION}" - done - working-directory: ./clients/js/ + # Update package.json with new version + jq --arg version "$NEW_VERSION" '.version = $version' $PKG_PATH > tmp.$$.json && mv tmp.$$.json $PKG_PATH + echo "Updated chromadb package to version ${NEW_VERSION}" + working-directory: ./clients/new-js/packages/chromadb/ - name: Update package.json with organization scope run: | ORG_NAME="@chroma-core" # Update chromadb package - CHROMADB_PKG="./packages/chromadb/package.json" + CHROMADB_PKG="./package.json" PACKAGE_NAME=$(jq -r '.name' $CHROMADB_PKG) jq --arg org "$ORG_NAME" --arg name "$PACKAGE_NAME" '.name = "\($org)/\($name)"' $CHROMADB_PKG > tmp.$$.json && mv tmp.$$.json $CHROMADB_PKG - # Update chromadb-client package - CLIENT_PKG="./packages/chromadb-client/package.json" - PACKAGE_NAME=$(jq -r '.name' $CLIENT_PKG) - jq --arg org "$ORG_NAME" --arg name "$PACKAGE_NAME" '.name = "\($org)/\($name)"' $CLIENT_PKG > tmp.$$.json && mv tmp.$$.json $CLIENT_PKG - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Publish dev packages run: pnpm publish -r --access public --no-git-checks --tag dev - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-javascript-client.yml b/.github/workflows/release-javascript-client.yml index 2cad6748ad7..934cccb94d3 100644 --- a/.github/workflows/release-javascript-client.yml +++ b/.github/workflows/release-javascript-client.yml @@ -10,6 +10,12 @@ on: tag: description: 'Tag to release' required: true + workflow_call: + inputs: + tag: + description: 'Tag to release' + required: true + type: string env: PNPM_CACHE_FOLDER: .cache/pnpm jobs: @@ -26,7 +32,7 @@ jobs: shell: bash run: | # If the workflow was triggered by a push on a tag, use github.ref_name. - # If manually dispatched, use the tag value supplied in the workflow input. + # If manually dispatched or called from another workflow, use the tag value supplied in the workflow input. if [[ "${{ github.event_name }}" == "push" ]]; then echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT else @@ -62,30 +68,25 @@ jobs: check-latest: false token: ${{ matrix.registry == 'https://registry.npmjs.org' && secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} cache: 'pnpm' - cache-dependency-path: 'clients/js/pnpm-lock.yaml' + cache-dependency-path: 'clients/new-js/packages/chromadb/pnpm-lock.yaml' - name: Install dependencies run: pnpm install --no-frozen-lockfile - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Build packages run: pnpm build - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Update package.json with organization scope for GitHub packages if: matrix.registry == 'https://npm.pkg.github.com' run: | # Update chromadb package - CHROMADB_PKG="./packages/chromadb/package.json" + CHROMADB_PKG="./package.json" ORG_NAME="@chroma-core" PACKAGE_NAME=$(jq -r '.name' $CHROMADB_PKG) jq --arg org "$ORG_NAME" --arg name "$PACKAGE_NAME" '.name = "\($org)/\($name)"' $CHROMADB_PKG > tmp.$$.json && mv tmp.$$.json $CHROMADB_PKG - - # Update chromadb-client package - CLIENT_PKG="./packages/chromadb-client/package.json" - PACKAGE_NAME=$(jq -r '.name' $CLIENT_PKG) - jq --arg org "$ORG_NAME" --arg name "$PACKAGE_NAME" '.name = "\($org)/\($name)"' $CLIENT_PKG > tmp.$$.json && mv tmp.$$.json $CLIENT_PKG - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ - name: Publish packages run: pnpm publish -r --access public --no-git-checks - working-directory: ./clients/js/ + working-directory: ./clients/new-js/packages/chromadb/ env: NODE_AUTH_TOKEN: ${{ matrix.registry == 'https://registry.npmjs.org' && secrets.NPM_TOKEN || secrets.GITHUB_TOKEN }} @@ -100,7 +101,7 @@ jobs: shell: bash run: | # If the workflow was triggered by a push on a tag, use github.ref_name. - # If manually dispatched, use the tag value supplied in the workflow input. + # If manually dispatched or called from another workflow, use the tag value supplied in the workflow input. if [[ "${{ github.event_name }}" == "push" ]]; then echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT else diff --git a/Cargo.lock b/Cargo.lock index a0c95648ee8..928729c6d42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1539,7 +1539,7 @@ dependencies = [ [[package]] name = "chroma-cli" -version = "1.2.0" +version = "1.2.1" dependencies = [ "arboard", "axum 0.8.1", diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 73edffac0da..fd0ed902973 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -1,20 +1,216 @@ ## Release Process -This guide covers how to release chroma to PyPi +This guide covers how to release chroma to PyPi, NPM, as well as releasing the standalone Chroma CLI. -#### Increase the version number -1. Create a new PR for the release that upgrades the version in code. Name it `release/A.B.C` In [this file](https://github.com/chroma-core/chroma/blob/main/chromadb/__init__.py) update the __ version __. The commit comment (and hence PR title) should be `[RELEASE] A.B.C` +### CLI + +**Note:** Use this path for releasing any Chroma server updates, or any CLI functionality updates. The CLI is bundled in both our Python and JS/TS packages, so this path also includes releasing both clients, with the updated CLI. + +1. Create a new branch for the release that upgrades the versions in code. The PR will upgrade the versions of the CLI and the clients. Name it `release/cli-[A.B.C]-python-[D.E.F]-js-[X.Y.Z]`. For example, for releasing CLI version `1.2.3`, Python client version `4.5.6`, and JS/TS client version `7.8.9`, you'd make a new branch: + +```shell +git checkout -b release/cli-1.2.3-python-4.5.6-js-7.8.9 +``` + +2. Update the CLI version in the [`rust/cli/Cargo.toml`](https://github.com/chroma-core/chroma/blob/main/rust/cli/Cargo.toml): + +```toml +version = "1.2.3" +``` + +3. Update the CLI version for `clap` in [`rust/cli/src/lib.rs`](https://github.com/chroma-core/chroma/blob/main/rust/cli/src/lib.rs): + +```rust +#[command(version = "1.2.3")] +``` + +4. Update the CLI version in the installation script ([`rust/cli/install/install.sh`](https://github.com/chroma-core/chroma/blob/main/rust/cli/install/install.sh)): + +```shell +RELEASE="cli-1.2.3" +``` + +5. Update the CLI version in the Windows installation script ([`rust/cli/install/install.ps1`](https://github.com/chroma-core/chroma/blob/main/rust/cli/install/install.ps1)) + +```powershell +$release = "cli-1.2.1" +``` + +6. Upgrade the version of the JS binding packages. These are NPM packages for various platforms containing CLI binaries. These packages have their own versions. Update the following `package.json` files. They should all be updated to the same version: +* [`rust/js_bindings/package.json`](https://github.com/chroma-core/chroma/blob/main/rust/js_bindings/package.json) +* [`rust/js_bindings/npm/darwin-arm64/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/darwin-arm64) +* [`rust/js_bindings/npm/darwin-x64/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/darwin-x64) +* [`rust/js_bindings/npm/linux-arm64-gnu/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/linux-arm64-gnu) +* [`rust/js_bindings/npm/linux-x64-gnu/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/linux-x64-gnu) +* [`rust/js_bindings/npm/win32-arm64-msvc/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/win32-arm64-msvc) +* [`rust/js_bindings/npm/win32-x64-msvc/package.json`](https://github.com/chroma-core/chroma/tree/main/rust/js_bindings/npm/win32-x64-msvc) + +```json +"version": "1.1.1" +``` + +7. Update the dependencies of the JS/TS client for the updated JS-bindings in [`clients/new-js/packages/chromadb/package.json`](https://github.com/chroma-core/chroma/blob/main/clients/new-js/packages/chromadb/package.json): + +```json +"optionalDependencies": { + "chromadb-js-bindings-darwin-arm64": "^1.1.1", + "chromadb-js-bindings-darwin-x64": "^1.1.1", + "chromadb-js-bindings-linux-arm64-gnu": "^1.1.1", + "chromadb-js-bindings-linux-x64-gnu": "^1.1.1", + "chromadb-js-bindings-win32-x64-msvc": "^1.1.1" +}, +``` + +8. In the same file ([`clients/new-js/packages/chromadb/package.json`](https://github.com/chroma-core/chroma/blob/main/clients/new-js/packages/chromadb/package.json)), update the JS/TS client version: + +```json +"name": "chromadb", +"version": "7.8.9", +``` + +9. Update the version for the Python client in [`chromadb/__init__.py`](https://github.com/chroma-core/chroma/blob/main/chromadb/__init__.py): + +```python +__version__ = "4.5.6" +``` + +10. The AWS CloudFormation template, as well as the TF Azure and GCP templates use the Python package to run a Chroma server via the CLI. Update these templates to download the correct version. + +[`deployments/aws/chroma.cf.json`](https://github.com/chroma-core/chroma/blob/main/deployments/aws/chroma.cf.json): + +```json +"Default": "4.5.6" +``` + +[`deployments/azure/chroma.tfvars.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/azure/chroma.tfvars.tf): + +```yaml +chroma_version = "4.5.6" +``` + +[`deployments/azure/main.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/azure/main.tf): + +```yaml +variable "chroma_version" { + description = "Chroma version to install" + default = "4.5.6" +} +``` + +[`deployments/gcp/chroma.tfvars.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/gcp/chroma.tfvars.tf): + +```yaml +chroma_version = "4.5.6" +``` + +[`deployments/gcp/main.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/gcp/main.tf): + +```yaml +variable "chroma_version" { + description = "Chroma version to install" + default = "4.5.6" +} +``` + +11. Make a new PR with your branch, and label it with the `release` label. +12. Once the PR is merged, and the GitHub actions pass on `main`, tag your commit SHA with the **CLI version name**, `cli_`, and push it. This will trigger a workflow that builds and releases the CLI and its JS bindings, as well as releasing both clients to PyPi and NPM. + +```shell +git tag cli_ +git push origin cli_ +``` + +Once the release workflow is done, you should see the new CLI and Python releases on the right-hand side on the Chroma repo under "Releases". + +13. Upload the AWS CloudFormation template to our public S3 bucket to be the "latest" template: `s3://public.trychroma.com/cloudformation/latest/` + +### Python + +**Note:** use this path for releasing python **client** side changes. + +1. Create a new branch for the release that upgrades the version in code. Name it `release/python-[A.B.C]`. For example, for releasing version `1.2.3` you'd make a new branch: + +```shell +git checkout -b release/python-1.2.3 +``` + +2. Update the version in [`chromadb/__init__.py`](https://github.com/chroma-core/chroma/blob/main/chromadb/__init__.py). For example, when releasing version `1.2.3`, set: + +```python +__version__ = "1.2.3" +``` + +3. The AWS CloudFormation template, as well as the TF Azure and GCP templates use the Python package to run a Chroma server via the CLI. Update these templates to download the correct version. + +[`deployments/aws/chroma.cf.json`](https://github.com/chroma-core/chroma/blob/main/deployments/aws/chroma.cf.json): + +```json +"Default": "1.2.3" +``` + +[`deployments/azure/chroma.tfvars.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/azure/chroma.tfvars.tf): + +```yaml +chroma_version = "1.2.3" ``` -__version__ = "A.B.C" + +[`deployments/azure/main.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/azure/main.tf): + +```yaml +variable "chroma_version" { + description = "Chroma version to install" + default = "1.2.3" +} ``` -2. On Github, add the "release" label to this PR -3. Once the PR checks pass, merge it. This will trigger Github Actions to release to PyPi, DockerHub, and the JS client. It may take a while before they complete. -4. Once the PR is merged and the Github Actions complete, tag your commit SHA with the release version + +[`deployments/gcp/chroma.tfvars.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/gcp/chroma.tfvars.tf): + +```yaml +chroma_version = "1.2.3" ``` -git tag A.B.C + +[`deployments/gcp/main.tf`](https://github.com/chroma-core/chroma/blob/main/deployments/gcp/main.tf): + +```yaml +variable "chroma_version" { + description = "Chroma version to install" + default = "1.2.3" +} ``` -5. Push your tag to origin to create the release. This will trigger more Github Actions to perform the release. + +4. Make a new PR with your branch, and label it with the `release` label. +5. Once the PR is merged, and the GitHub actions pass on `main`, tag your commit SHA with the version name and push it. This will trigger a workflow that performs the release to PyPi. + +```shell +git tag +git push origin ``` -git push origin A.B.C + +Once the release workflow is done, you should see the new release on the right-hand side on the Chroma repo under "Releases". + +6. Upload the AWS CloudFormation template to our public S3 bucket to be the "latest" template: `s3://public.trychroma.com/cloudformation/latest/` + +### Javascript/Typescript + +**Note:** use this path for releasing JS/TS **client** side changes. + +1. Create a new branch for the release that upgrades the version in code. Name it `release/js-[A.B.C]`. For example, for releasing version `1.2.3` you'd make a new branch: + +```shell +git checkout -b release/js-1.2.3 +``` + +2. Update the version in [`clients/new-js/packages/chromadb/package.json`](https://github.com/chroma-core/chroma/blob/main/clients/new-js/packages/chromadb/package.json). For example, when releasing version `1.2.3`, set: + +```json +"version": "1.2.3" ``` -6. On the right panel on Github, click on "Releases", and the new release should appear first. Make sure it is marked as "latest". + +3. Make a new PR with your branch, and label it with the `release` label. +4. Once the PR is merged, and the GitHub actions pass on `main`, tag your commit SHA with `js_release_` and push it. This will trigger a workflow that performs the release to NPM. + +```shell +git tag +git push origin +``` +