Skip to content

Commit bb00428

Browse files
committed
Separating out publish workflow
1 parent 541610e commit bb00428

File tree

3 files changed

+81
-18
lines changed

3 files changed

+81
-18
lines changed

.github/workflows/publish.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: "Test"
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
paths:
8+
# Always run when workflow configs change
9+
- ".github/workflows/**"
10+
# Run when package changes
11+
- "**"
12+
release:
13+
types: [published]
14+
15+
pull_request:
16+
branches:
17+
- "main"
18+
paths:
19+
# Always run when workflow configs change
20+
- ".github/workflows/**"
21+
# Run when package changes
22+
- "**"
23+
24+
workflow_dispatch: {}
25+
26+
jobs:
27+
test_client:
28+
runs-on: ubuntu-latest
29+
30+
permissions:
31+
contents: read
32+
id-token: write
33+
34+
strategy:
35+
matrix:
36+
python-version:
37+
- 3.9
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- uses: actions/setup-python@v4
43+
id: setup_python
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
cache: "pip"
47+
cache-dependency-path: |
48+
poetry.lock
49+
50+
- name: Install dependencies (tests)
51+
run: |
52+
pip install pytest pytest-asyncio pytest-mock requests-mock
53+
54+
- name: Install dependencies
55+
working-directory: .
56+
run: |
57+
pip install -e .
58+
59+
- name: Run tests
60+
working-directory: .
61+
run: |
62+
echo $COHERE_API_KEY
63+
pytest -sv tests/test_compass_client.py
64+
pypi-publish:
65+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
66+
runs-on: ubuntu-latest
67+
needs:
68+
- test_client
69+
permissions:
70+
id-token: write
71+
72+
steps:
73+
- name: Retrieve release distributions
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: release-dists
77+
path: dist/
78+
- name: Publish release distributions to PyPI
79+
uses: pypa/gh-action-pypi-publish@3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f

.github/workflows/test_publish.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Test and Publish"
1+
name: "Test"
22

33
on:
44
push:
@@ -61,19 +61,3 @@ jobs:
6161
run: |
6262
echo $COHERE_API_KEY
6363
pytest -sv tests/test_compass_client.py
64-
pypi-publish:
65-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
66-
runs-on: ubuntu-latest
67-
needs:
68-
- test_client
69-
permissions:
70-
id-token: write
71-
72-
steps:
73-
- name: Retrieve release distributions
74-
uses: actions/download-artifact@v4
75-
with:
76-
name: release-dists
77-
path: dist/
78-
- name: Publish release distributions to PyPI
79-
uses: pypa/gh-action-pypi-publish@3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "compass-sdk"
3-
version = "release.narwhal"
3+
version = "0.0.1"
44
authors = []
55
description = "Compass SDK"
66

0 commit comments

Comments
 (0)