mirror of
https://github.com/ZGCA-Forge/MsgCenterPy.git
synced 2026-02-04 05:15:14 +00:00
Update publish.yml
This commit is contained in:
24
.github/workflows/publish.yml
vendored
24
.github/workflows/publish.yml
vendored
@@ -169,13 +169,31 @@ jobs:
|
|||||||
- name: Verify version consistency
|
- name: Verify version consistency
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(python -c "import msgcenterpy; print(msgcenterpy.__version__)" 2>/dev/null || echo "unknown")
|
# Install package first
|
||||||
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
pip install -e .
|
||||||
|
|
||||||
|
# Get package version (fail fast if not available)
|
||||||
|
VERSION=$(python -c "import msgcenterpy; print(msgcenterpy.__version__)")
|
||||||
|
|
||||||
|
# Handle both v0.0.3 and 0.0.3 tag formats
|
||||||
|
RAW_TAG="${GITHUB_REF#refs/tags/}"
|
||||||
|
if [[ "$RAW_TAG" == v* ]]; then
|
||||||
|
TAG_VERSION="${RAW_TAG#v}"
|
||||||
|
else
|
||||||
|
TAG_VERSION="$RAW_TAG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Package version: $VERSION"
|
||||||
|
echo "Tag version: $TAG_VERSION"
|
||||||
|
|
||||||
if [ "$VERSION" != "$TAG_VERSION" ]; then
|
if [ "$VERSION" != "$TAG_VERSION" ]; then
|
||||||
echo "Version mismatch: package=$VERSION, tag=$TAG_VERSION"
|
echo "❌ Version mismatch: package=$VERSION, tag=$TAG_VERSION"
|
||||||
|
echo "Please ensure the package version matches the git tag"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "✅ Version verification passed: $VERSION"
|
||||||
|
|
||||||
- name: Build release distributions
|
- name: Build release distributions
|
||||||
run: |
|
run: |
|
||||||
python -m build
|
python -m build
|
||||||
|
|||||||
Reference in New Issue
Block a user