diff --git a/.github/workflows/chroma-release-python-client.yml b/.github/workflows/chroma-release-python-client.yml index fbcd7d320b3..f9507ca7d6b 100644 --- a/.github/workflows/chroma-release-python-client.yml +++ b/.github/workflows/chroma-release-python-client.yml @@ -3,14 +3,27 @@ name: Chroma Release Python Client on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' # Match tags in the form X.Y.Z + - '[0-9]+.[0-9]+.[0-9]+' # Match tags in the form X.Y.Z branches: - main - hammad/thin_client jobs: + check_tag: + runs-on: ubuntu-latest + outputs: + tag_matches: ${{ steps.check-tag.outputs.match }} + steps: + - name: Check Tag + id: check-tag + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "tag_matches=true" >> $GITHUB_OUTPUT + fi build-and-release: runs-on: ubuntu-latest + needs: check_tag + if: needs.check_tag.outputs.tag_matches == 'true' permissions: write-all steps: - name: Checkout diff --git a/.github/workflows/chroma-release.yml b/.github/workflows/chroma-release.yml index 65626d270aa..a397cfc59b2 100644 --- a/.github/workflows/chroma-release.yml +++ b/.github/workflows/chroma-release.yml @@ -3,7 +3,7 @@ name: Chroma Release on: push: tags: - - 'v[0-9]+.[0-9]+.[0-9]+' # Match tags in the form X.Y.Z + - '*' branches: - main @@ -13,8 +13,21 @@ env: PLATFORMS: linux/amd64,linux/arm64 #linux/riscv64, linux/arm/v7 jobs: + check_tag: + runs-on: ubuntu-latest + outputs: + tag_matches: ${{ steps.check-tag.outputs.match }} + steps: + - name: Check Tag + id: check-tag + run: | + if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "tag_matches=true" >> $GITHUB_OUTPUT + fi build-and-release: runs-on: ubuntu-latest + needs: check_tag + if: needs.check_tag.outputs.tag_matches == 'true' permissions: write-all # id-token: write # contents: read diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index ae67156782f..577345c8fae 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -3,20 +3,20 @@ This guide covers how to release chroma to PyPi #### Increase the version number -1. Create a new PR for the release that upgrades the version in code. Name it `release/vA.B.C` In [this file](https://github.com/chroma-core/chroma/blob/main/chromadb/__init__.py) update the __ version __. +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 __. ``` __version__ = "A.B.C" ``` 2. Add the "release" label to this PR 3. Once the PR is merged, tag your commit SHA with the release version ``` -git tag vA.B.C +git tag A.B.C ``` 4. You need to then wait for the github action for main for `chroma release` and `chroma client release` to go green. Not doing this will result in a race condition. #### Perform the release 1. Push your tag to origin to create the release ``` -git push origin vA.B.C +git push origin A.B.C ``` 2. This will trigger a Github action which performs the release