Skip to content

Commit e6c88d1

Browse files
authored
fix(release): set PYTHON_PATH in semantic_release; hard-code fallback (#836)
* Update release-and-publish.yml: set PYTHON_PATH in semantic_release * Update pyproject.toml: hard code python path fallback
1 parent 0f5166e commit e6c88d1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/release-and-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ jobs:
201201
- name: Python Semantic Release
202202
id: semantic_release
203203
uses: python-semantic-release/[email protected]
204+
env:
205+
PYTHON_PATH: ${{ env.PYTHON_PATH }}
204206
with:
205207
github_token: ${{ secrets.ADMIN_TOKEN }} # Use the new token for authentication
206208
git_committer_name: "OpenAdapt Bot"

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,13 @@ pip install poetry && \
161161
echo "PYTHON_PATH is set to: $PYTHON_PATH" && \
162162
if [ -z \"$PYTHON_PATH\" ]; then \
163163
echo "PYTHON_PATH is empty, using default python3.10" && \
164-
poetry env use python3.10; \
164+
POETRY_PYTHON_PATH=$(which python3.10 || dirname $(ls /opt/hostedtoolcache/Python/3.10*/x64/bin/python3.10 | tail -n 1)/python3.10) && \
165+
echo "Resolved Python path: $POETRY_PYTHON_PATH" && \
166+
poetry env use $POETRY_PYTHON_PATH; \
165167
else \
166168
echo "Using python from PYTHON_PATH: $PYTHON_PATH/python3.10" && \
167169
poetry env use $PYTHON_PATH/python3.10; \
168170
fi && \
169171
poetry build
170172
"""
173+

0 commit comments

Comments
 (0)