Skip to content

Commit f2f4138

Browse files
Enable test pypi flow (#157)
Adds appropriate github actions workflow to test the library in test-pypi before the production release.
1 parent 934d269 commit f2f4138

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

.github/workflows/release.yml

+57-57
Original file line numberDiff line numberDiff line change
@@ -38,65 +38,65 @@ jobs:
3838
name: dist
3939
path: dist/
4040

41-
# test-pypi-publish:
42-
# needs: build
43-
# runs-on: ubuntu-latest
44-
45-
# steps:
46-
# - uses: actions/checkout@v4
47-
48-
# - name: Set up Python
49-
# uses: actions/setup-python@v4
50-
# with:
51-
# python-version: ${{ env.PYTHON_VERSION }}
52-
53-
# - name: Install Poetry
54-
# uses: snok/install-poetry@v1
55-
56-
# - uses: actions/download-artifact@v4
57-
# with:
58-
# name: dist
59-
# path: dist/
60-
61-
# - name: Publish to TestPyPI
62-
# env:
63-
# POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }}
64-
# run: poetry config repositories.test-pypi https://test.pypi.org/legacy/; poetry config pypi-token.test-pypi $POETRY_PYPI_TOKEN_TESTPYPI; poetry publish --repository test-pypi
65-
66-
# pre-release-checks:
67-
# needs: test-pypi-publish
68-
# runs-on: ubuntu-latest
69-
70-
# steps:
71-
# - uses: actions/checkout@v4
72-
73-
# - name: Set up Python
74-
# uses: actions/setup-python@v4
75-
# with:
76-
# python-version: ${{ env.PYTHON_VERSION }}
77-
78-
# - name: Install Poetry
79-
# uses: snok/install-poetry@v1
80-
81-
# - name: Install dependencies
82-
# run: |
83-
# poetry install --all-extras
84-
85-
# - name: Install published package from TestPyPI
86-
# env:
87-
# OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
88-
# GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
89-
# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
90-
# COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
91-
# AZURE_OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}}
92-
# AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
93-
# AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
94-
# OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
95-
# run:
96-
# poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl-test; poetry run test-cov
41+
test-pypi-publish:
42+
needs: build
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: ${{ env.PYTHON_VERSION }}
52+
53+
- name: Install Poetry
54+
uses: snok/install-poetry@v1
55+
56+
- uses: actions/download-artifact@v4
57+
with:
58+
name: dist
59+
path: dist/
60+
61+
- name: Publish to TestPyPI
62+
env:
63+
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }}
64+
run: poetry config repositories.test-pypi https://test.pypi.org/legacy/; poetry config pypi-token.test-pypi $POETRY_PYPI_TOKEN_TESTPYPI; poetry publish --repository test-pypi
65+
66+
pre-release-checks:
67+
needs: test-pypi-publish
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Set up Python
74+
uses: actions/setup-python@v4
75+
with:
76+
python-version: ${{ env.PYTHON_VERSION }}
77+
78+
- name: Install Poetry
79+
uses: snok/install-poetry@v1
80+
81+
- name: Install dependencies
82+
run: |
83+
poetry install --all-extras
84+
85+
- name: Install published package from TestPyPI
86+
env:
87+
OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
88+
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
89+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
90+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
91+
AZURE_OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}}
92+
AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
93+
AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
94+
OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
95+
run:
96+
poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl; poetry run test-cov
9797

9898
publish:
99-
needs: build #pre-release-checks
99+
needs: pre-release-checks
100100
runs-on: ubuntu-latest
101101

102102
steps:

0 commit comments

Comments
 (0)