Skip to content

Commit 37a2ba3

Browse files
committed
fix(CD): update publish PyPI workflow
1 parent b25f1ca commit 37a2ba3

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,17 @@ jobs:
3434
if [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
3535
VERSION="${GITHUB_REF#refs/tags/}"
3636
VERSION="${VERSION#v}"
37-
echo "from=tag" >> "$GITHUB_OUTPUT"
38-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
39-
echo "Publishing version from tag: $VERSION"
37+
FROM=tag
4038
else
41-
# Fallback to version defined in src/MCPStack/__init__.py when manually dispatched or on branches
42-
VERSION=$(python - <<'PY'
43-
import re, pathlib
44-
p = pathlib.Path('src/MCPStack/__init__.py')
45-
m = re.search(r'__version__\s*=\s*"([^"]+)"', p.read_text())
46-
print(m.group(1) if m else '')
47-
PY
48-
)
39+
VERSION=$(python -c "import re,pathlib; p=pathlib.Path('src/MCPStack/__init__.py'); m=re.search(r'__version__\\s*=\\s*\"([^\"]+)\"', p.read_text()); print(m.group(1) if m else '')")
40+
FROM=init
4941
if [[ -z "$VERSION" ]]; then
5042
echo "::error ::Could not determine version from src/MCPStack/__init__.py"; exit 1
5143
fi
52-
echo "from=init" >> "$GITHUB_OUTPUT"
53-
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
54-
echo "Publishing version from __init__.py: $VERSION"
5544
fi
45+
echo "from=$FROM" >> "$GITHUB_OUTPUT"
46+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
47+
echo "Publishing version: $VERSION (source: $FROM)"
5648
5749
- name: Verify version consistency
5850
run: |

0 commit comments

Comments
 (0)