5 Commits
0.0.3 ... 0.0.5

Author SHA1 Message Date
Xuwznln
9d6d21de62 Bump version: 0.0.4 → 0.0.5 2025-09-03 13:09:22 +08:00
Xuwznln
502d4c4c04 Update publish.yml 2025-09-03 13:09:03 +08:00
Xuwznln
02f3216456 Update publish.yml 2025-09-03 13:04:30 +08:00
Xuwznln
a871c11df8 Bump version: 0.0.3 → 0.0.4 2025-09-03 12:59:30 +08:00
Xuwznln
7d1bc307ee Update publish.yml 2025-09-03 12:59:22 +08:00
3 changed files with 30 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
[bumpversion] [bumpversion]
current_version = 0.0.3 current_version = 0.0.5
commit = True commit = True
tag = True tag = True
tag_name = v{new_version} tag_name = v{new_version}

View File

@@ -10,7 +10,7 @@ name: Upload PyPI package
on: on:
release: release:
types: [published] types: [published, edited]
workflow_dispatch: workflow_dispatch:
inputs: inputs:
test_pypi: test_pypi:
@@ -167,15 +167,33 @@ jobs:
python -m pip install build twine python -m pip install build twine
- name: Verify version consistency - 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: | 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
@@ -195,7 +213,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- release-build - 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: permissions:
# IMPORTANT: this permission is mandatory for trusted publishing # IMPORTANT: this permission is mandatory for trusted publishing
id-token: write id-token: write
@@ -218,7 +236,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- release-build - 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: permissions:
# IMPORTANT: this permission is mandatory for trusted publishing # IMPORTANT: this permission is mandatory for trusted publishing
id-token: write id-token: write
@@ -242,7 +260,9 @@ jobs:
name: Add assets to GitHub release name: Add assets to GitHub release
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: release-build 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: steps:
- name: Retrieve release distributions - name: Retrieve release distributions

View File

@@ -5,7 +5,7 @@ A multi-format message conversion system supporting seamless conversion
between ROS2, Pydantic, Dataclass, JSON, Dict, YAML and JSON Schema. between ROS2, Pydantic, Dataclass, JSON, Dict, YAML and JSON Schema.
""" """
__version__ = "0.0.3" __version__ = "0.0.5"
__license__ = "Apache-2.0" __license__ = "Apache-2.0"
from msgcenterpy.core.envelope import MessageEnvelope, create_envelope from msgcenterpy.core.envelope import MessageEnvelope, create_envelope