mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-10 22:41:17 +00:00
ci: add version-check to publish-pipecat-sdk-python
This commit is contained in:
parent
ac17eaee3e
commit
d0038cfef2
1 changed files with 17 additions and 0 deletions
17
.github/workflows/publish-pipecat-sdk-python.yml
vendored
17
.github/workflows/publish-pipecat-sdk-python.yml
vendored
|
|
@ -25,13 +25,30 @@ jobs:
|
|||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Check if version changed
|
||||
id: version-check
|
||||
run: |
|
||||
LOCAL_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
||||
PACKAGE_NAME=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['name'])")
|
||||
PIP_VERSION=$(curl -s "https://pypi.org/pypi/$PACKAGE_NAME/json" 2>/dev/null | python -c "import sys,json; print(json.load(sys.stdin)['info']['version'])" 2>/dev/null || echo "0.0.0")
|
||||
if [ "$LOCAL_VERSION" = "$PIP_VERSION" ]; then
|
||||
echo "Version $LOCAL_VERSION already published, skipping."
|
||||
echo "changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Publishing $LOCAL_VERSION (PyPI has $PIP_VERSION)"
|
||||
echo "changed=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Install build dependencies
|
||||
if: steps.version-check.outputs.changed == 'true'
|
||||
run: pip install hatchling build
|
||||
|
||||
- name: Build package
|
||||
if: steps.version-check.outputs.changed == 'true'
|
||||
run: python -m build
|
||||
|
||||
- name: Publish to PyPI
|
||||
if: steps.version-check.outputs.changed == 'true'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
packages-dir: packages/pipecat-sdk-python/dist/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue