Skip to content

Commit 2bf6657

Browse files
committed
add the sdk publish
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
1 parent df8ffe5 commit 2bf6657

1 file changed

Lines changed: 17 additions & 37 deletions

File tree

.github/workflows/publish-evaluator-sdk.yml

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,27 @@ permissions:
1414
contents: read
1515

1616
jobs:
17-
build:
17+
publish:
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v6
20+
- name: 'Checkout GitHub Action'
21+
uses: actions/checkout@main
2122

22-
- uses: actions/setup-python@v5
23-
with:
24-
python-version: '3.12'
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v6
2525

26-
- name: Verify tag matches pyproject.toml version
26+
- name: 'Release Python Packages'
27+
working-directory: packages/evaluator-sdk-py
2728
run: |
28-
REF=${{ github.event.inputs.tag || github.ref_name }}
29-
TOML_VERSION=$(grep '^version' packages/evaluator-sdk-py/pyproject.toml | cut -d'"' -f2)
30-
TAG_VERSION=${REF#evaluator-sdk-v}
31-
if [ "$TOML_VERSION" != "$TAG_VERSION" ]; then
32-
echo "Error: $REF does not match packages/evaluator-sdk-py/pyproject.toml version $TOML_VERSION"
33-
exit 1
29+
# if workflow_dispatch is used, use the version input
30+
if [ -n "${{ github.event.inputs.version }}" ]; then
31+
export VERSION=${{ github.event.inputs.version }}
32+
else
33+
export VERSION=$(echo "$GITHUB_REF" | cut -c12-)
3434
fi
35+
uv sync --all-extras
36+
# Bump every package version to $VERSION first
37+
uv version $VERSION --package agentevals-evaluator-sdk
3538
36-
- name: Install build tool
37-
run: pip install build
38-
39-
- name: Build wheel and sdist
40-
run: python -m build packages/evaluator-sdk-py/ --outdir dist/
41-
42-
- uses: actions/upload-artifact@v7
43-
with:
44-
name: evaluator-sdk-dist
45-
path: dist/
46-
47-
publish:
48-
needs: build
49-
runs-on: ubuntu-latest
50-
environment: pypi
51-
permissions:
52-
id-token: write
53-
54-
steps:
55-
- uses: actions/download-artifact@v8
56-
with:
57-
name: evaluator-sdk-dist
58-
path: dist/
59-
60-
- uses: pypa/gh-action-pypi-publish@release/v1
39+
uv build --package agentevals-evaluator-sdk
40+
uv publish --token ${{ secrets.PYPI_TOKEN }

0 commit comments

Comments
 (0)