File tree Expand file tree Collapse file tree 2 files changed +13
-13
lines changed
Expand file tree Collapse file tree 2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 5050 id : bump
5151 run : |
5252 BUMP_TYPE="${{ inputs.bump }}"
53-
53+
5454 # For alpha/beta/rc, we need to bump minor first if not already a prerelease
5555 if [[ "$BUMP_TYPE" =~ ^(alpha|beta|rc)$ ]]; then
5656 CURRENT_VERSION=$(uv version --short)
@@ -62,12 +62,12 @@ jobs:
6262 else
6363 uv version --bump "$BUMP_TYPE"
6464 fi
65-
65+
6666 # Get the new version
6767 NEW_VERSION=$(uv version --short)
6868 echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
6969 echo "New version: $NEW_VERSION"
70-
70+
7171 # Check if it's a prerelease version
7272 if [[ "$NEW_VERSION" =~ (a|b|rc)[0-9]+ ]]; then
7373 echo "is_prerelease=true" >> $GITHUB_OUTPUT
7878 - name : Sync version to __init__.py
7979 run : |
8080 VERSION="${{ steps.bump.outputs.new_version }}"
81- sed -i "s/__version__ = \".*\"/__version__ = \"$VERSION\"/" src/ryandata_address_utils/__init__.py
81+ sed -i "s/^ __version__ = \".*\"/__version__ = \"$VERSION\"/" src/ryandata_address_utils/__init__.py
8282 echo "Updated __init__.py to version $VERSION"
83- cat src/ryandata_address_utils/__init__.py | grep __version__
83+ grep -E '^__version__ = ' src/ryandata_address_utils/__init__.py
8484
8585 - name : Commit version bump
8686 run : |
Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ jobs:
3333 # Get version from pyproject.toml
3434 PYPROJECT_VERSION=$(uv version | awk '{print $2}')
3535 echo "pyproject.toml version: $PYPROJECT_VERSION"
36-
37- # Get version from __init__.py (using sed for portability )
38- INIT_VERSION=$(grep ' __version__' src/ryandata_address_utils/__init__.py | sed 's/.* "\(.*\)".* /\1/')
36+
37+ # Get version from __init__.py (match only the assignment line, not __all__ )
38+ INIT_VERSION=$(grep -E '^ __version__ = ' src/ryandata_address_utils/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
3939 echo "__init__.py version: $INIT_VERSION"
40-
40+
4141 # Compare versions
4242 if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then
4343 echo "❌ Version mismatch!"
4444 exit 1
4545 fi
46-
46+
4747 echo "✅ Versions are in sync: $PYPROJECT_VERSION"
4848 echo "version=$PYPROJECT_VERSION" >> $GITHUB_OUTPUT
4949
@@ -71,17 +71,17 @@ jobs:
7171 run : |
7272 VERSION="${{ needs.check-version-sync.outputs.version }}"
7373 echo "VERSION: '$VERSION'"
74-
74+
7575 if [ -z "$VERSION" ]; then
7676 echo "ERROR: VERSION is empty!"
7777 exit 1
7878 fi
79-
79+
8080 TAG_NAME="v$VERSION"
8181 echo "Checking for tag: $TAG_NAME"
8282 echo "Existing tags:"
8383 git tag -l
84-
84+
8585 if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
8686 echo "Tag $TAG_NAME exists locally"
8787 echo "created=false" >> $GITHUB_OUTPUT
You can’t perform that action at this time.
0 commit comments