Skip to content

Commit

Permalink
fix: Use HEREDOC for version extraction (#27)
Browse files Browse the repository at this point in the history
* fix: Escape version number

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

* fix

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

* fix

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

* fix

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>

---------

Signed-off-by: Oliver Koenig <okoenig@nvidia.com>
  • Loading branch information
ko3n1g authored Nov 7, 2024
1 parent 738a898 commit 26b50b1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/_build_test_publish_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,17 @@ jobs:
sed -i "/^PATCH/c\PATCH = $((RANDOM % 9000 + 1000))" $PYPROJECT_NAME/package_info.py
fi
EXPECTED_VERSION=$(python -c "import $PYPROJECT_NAME; print($PYPROJECT_NAME.__version__)")
cmd=$(cat <<EOF
import $PYPROJECT_NAME
with open("version.txt", "w") as fh:
fh.write($PYPROJECT_NAME.__version__)
EOF
)
python -c "$cmd"
EXPECTED_VERSION=$(cat version.txt)
echo "version=$EXPECTED_VERSION" | tee -a "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 26b50b1

Please sign in to comment.