mirror of
https://github.com/ZGCA-Forge/MsgCenterPy.git
synced 2026-02-12 10:45:13 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d6d21de62 | ||
|
|
502d4c4c04 | ||
|
|
02f3216456 | ||
|
|
a871c11df8 | ||
|
|
7d1bc307ee |
@@ -1,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 0.0.3
|
||||
current_version = 0.0.5
|
||||
commit = True
|
||||
tag = True
|
||||
tag_name = v{new_version}
|
||||
|
||||
36
.github/workflows/publish.yml
vendored
36
.github/workflows/publish.yml
vendored
@@ -10,7 +10,7 @@ name: Upload PyPI package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
types: [published, edited]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
test_pypi:
|
||||
@@ -167,15 +167,33 @@ jobs:
|
||||
python -m pip install build twine
|
||||
|
||||
- name: Verify version consistency
|
||||
if: github.event_name == 'release'
|
||||
if: github.event_name == 'release' && (github.event.action == 'published' || (github.event.action == 'edited' && !github.event.release.prerelease))
|
||||
run: |
|
||||
VERSION=$(python -c "import msgcenterpy; print(msgcenterpy.__version__)" 2>/dev/null || echo "unknown")
|
||||
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
||||
# Install package first
|
||||
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
|
||||
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
|
||||
fi
|
||||
|
||||
echo "✅ Version verification passed: $VERSION"
|
||||
|
||||
- name: Build release distributions
|
||||
run: |
|
||||
python -m build
|
||||
@@ -195,7 +213,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- release-build
|
||||
if: github.event_name == 'release' && !github.event.release.prerelease && github.event.inputs.test_pypi != 'true'
|
||||
if: github.event_name == 'release' && !github.event.release.prerelease && github.event.inputs.test_pypi != 'true' && (github.event.action == 'published' || github.event.action == 'edited')
|
||||
permissions:
|
||||
# IMPORTANT: this permission is mandatory for trusted publishing
|
||||
id-token: write
|
||||
@@ -218,7 +236,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- release-build
|
||||
if: github.event.inputs.test_pypi == 'true' || (github.event_name == 'release' && github.event.release.prerelease)
|
||||
if: github.event.inputs.test_pypi == 'true' || (github.event_name == 'release' && github.event.release.prerelease && (github.event.action == 'published' || github.event.action == 'edited'))
|
||||
permissions:
|
||||
# IMPORTANT: this permission is mandatory for trusted publishing
|
||||
id-token: write
|
||||
@@ -242,7 +260,9 @@ jobs:
|
||||
name: Add assets to GitHub release
|
||||
runs-on: ubuntu-latest
|
||||
needs: release-build
|
||||
if: github.event_name == 'release'
|
||||
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'edited')
|
||||
permissions:
|
||||
contents: write # Need write access to upload release assets
|
||||
|
||||
steps:
|
||||
- name: Retrieve release distributions
|
||||
|
||||
@@ -5,7 +5,7 @@ A multi-format message conversion system supporting seamless conversion
|
||||
between ROS2, Pydantic, Dataclass, JSON, Dict, YAML and JSON Schema.
|
||||
"""
|
||||
|
||||
__version__ = "0.0.3"
|
||||
__version__ = "0.0.5"
|
||||
__license__ = "Apache-2.0"
|
||||
|
||||
from msgcenterpy.core.envelope import MessageEnvelope, create_envelope
|
||||
|
||||
Reference in New Issue
Block a user