Skip to content

Commit 70975c0

Browse files
committed
Fix workflow invalid
1 parent b87c636 commit 70975c0

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/push_pypi.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,24 @@ jobs:
2121
python-version: '3.12'
2222

2323
- name: Check if version bumped
24+
id: check_version
2425
run: |
2526
current_version=$(uv version --short)
26-
pypi_version=$(pip index version mmirage --disable-pip-version-check | grep "Available versions:" | sed -E 's/.*Available versions: ([^,]+).*/\1/')
27+
pypi_version=$(pip index versions mmirage --disable-pip-version-check | grep "Available versions:" | sed -E 's/.*Available versions: ([^,]+).*/\1/')
2728
if [ "$current_version" = "$pypi_version" ]; then
2829
echo "Version not bumped. Exiting."
29-
exit 1
30+
echo "version_changed=0" >> $GITHUB_OUTPUT
3031
else
3132
echo "Version bumped from $pypi_version to $current_version."
33+
echo "version_changed=1" >> $GITHUB_OUTPUT
3234
fi
3335
3436
- name: Build package
37+
if: {{ steps.check_version.outputs.version_changed == '1' }}
3538
run: |
3639
uv build
3740
3841
- name: Publish to PyPI
42+
if: {{ steps.check_version.outputs.version_changed == '1' }}
3943
run: |
40-
uv publish --token ${{ secrets.PYPI_API_TOKEN }}
44+
uv publish --token ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)