Skip to content

Commit

Permalink
[BLD] Make python release processes add a check tag step
Browse files Browse the repository at this point in the history
  • Loading branch information
HammadB committed Sep 6, 2023
1 parent 242d165 commit 3e83d17
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/chroma-release-python-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/chroma-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <SHA>
git tag A.B.C <SHA>
```
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

0 comments on commit 3e83d17

Please sign in to comment.