From 8d8cf3432ae8e609e14bd38e9ccf4d49d49cad32 Mon Sep 17 00:00:00 2001 From: William Dutton Date: Tue, 10 Dec 2024 11:22:56 +1000 Subject: [PATCH] fix: publish via pyproject.toml instead of setup.py for version details --- .github/workflows/publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 26225538..df99051b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -44,10 +44,11 @@ jobs: - name: Validate tag version if: ${{ startsWith(github.ref, 'refs/tags') }} run: | + TAG_VALUE=${GITHUB_REF/refs\/tags\//} PYTHON_VERSION=$(grep -E '\bversion\s?=\s?"[^"]+"' pyproject.toml | awk -F '"' '{print $2}') echo "Tag version is [${{ steps.version.outputs.version }}], Python version is [$PYTHON_VERSION]" - if [ "${{ steps.version.outputs.version }}" != "$PYTHON_VERSION" ]; then - echo "Version mismatch; tag version is [${{ steps.version.outputs.version }}] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY + if [ "$TAG_VALUE" != "$PYTHON_VERSION" ]; then + echo "Version mismatch; tag version is [$TAG_VALUE] but Python version is [$PYTHON_VERSION]" >> $GITHUB_STEP_SUMMARY exit 1 fi