forked from chroma-core/chroma
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (56 loc) · 1.86 KB
/
chroma-release-python-client.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Chroma Release Python Client
on:
push:
tags:
- '[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.tag_matches }}
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
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Client Dev Dependencies
run: python -m pip install -r ./clients/python/requirements.txt && python -m pip install -r ./clients/python/requirements_dev.txt
- name: Build Client
run: ./clients/python/build_python_thin_client.sh
- 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: Get current date
id: builddate
run: echo "builddate=$(date +'%Y-%m-%dT%H:%M')" >> $GITHUB_OUTPUT
- 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/
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_PYTHON_CLIENT_PUBLISH_KEY }}