diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f701810a..4d6153f3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -114,7 +114,7 @@ jobs: #!/bin/bash TAG_VALUE=${GITHUB_REF/refs\/tags\//} - echo "version=${TAG_VALUE}" >> $GITHUB_ENV + echo "version=${TAG_VALUE}" >> $GITHUB_OUTPUT # Extract the repository name (minus the owner/org) reponame=$(basename $GITHUB_REPOSITORY) @@ -136,9 +136,10 @@ jobs: - name: Validate tag version if: ${{ startsWith(github.ref, 'refs/tags') }} run: | - PYTHON_VERSION=$(grep "\bversion='[^']+'" | awk -F "'" '{print $2}') - if [ "${steps.version.outputs.version}" != "$PYTHON_VERSION" ]; then - echo "Version mismatch; tag version is [${steps.version.outputs.version}] but Python version is [$PYTHON_VERSION]" + PYTHON_VERSION=$(grep -E "\bversion='[^']+'" setup.py | 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 exit 1 fi