Skip to content

Commit e4ccfd8

Browse files
author
Alex Godoroja
committed
ci: fix stupid command
1 parent f084fa9 commit e4ccfd8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/publish-python-sdk.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ jobs:
139139
LATEST_TAG=$(git describe --tags --match "$DEV_TAG_PATTERN" --abbrev=0 2>/dev/null || echo "sdk-dev-${SAFE_BRANCH}-v0.1.0")
140140
fi
141141
142-
# Extract version without prefix
143-
BASE_VERSION=$(echo "$LATEST_TAG" | grep -oP '(?<=v)[0-9]+\.[0-9]+\.[0-9]+$')
142+
# Extract version without prefix (compatible with both Linux and macOS)
143+
BASE_VERSION=$(echo "$LATEST_TAG" | sed 's/.*v\([0-9]*\.[0-9]*\.[0-9]*\)$/\1/')
144144
145145
# Count commits since last tag (only in sdk/python directory)
146146
COMMITS_SINCE_TAG=$(git rev-list ${LATEST_TAG}..HEAD --count -- . 2>/dev/null || echo "0")
@@ -256,9 +256,9 @@ jobs:
256256
- name: Extract version from wheel
257257
id: extract-version
258258
run: |
259-
# Get version from first wheel filename
259+
# Get version from first wheel filename (compatible with both Linux and macOS)
260260
WHEEL_FILE=$(ls dist/*.whl | head -1)
261-
VERSION=$(echo "$WHEEL_FILE" | grep -oP 'pilotprotocol-\K[0-9]+\.[0-9]+\.[0-9]+(\.(dev|post|rc|a|b)[0-9]+)?(\+[a-f0-9]+)?' || echo "0.1.0")
261+
VERSION=$(echo "$WHEEL_FILE" | sed -n 's/.*pilotprotocol-\([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[a-z0-9]\+\)\?\(+[a-z0-9]\+\)\?\).*/\1/p' || echo "0.1.0")
262262
echo "version=$VERSION" >> $GITHUB_OUTPUT
263263
echo "Extracted version: $VERSION"
264264
@@ -330,7 +330,7 @@ jobs:
330330
fi
331331
332332
SAFE_BRANCH=$(echo "$BRANCH" | sed 's/[^a-zA-Z0-9-]/-/g' | sed 's/^build-//')
333-
BASE_VERSION=$(echo "$VERSION" | grep -oP '^[0-9]+\.[0-9]+\.[0-9]+')
333+
BASE_VERSION=$(echo "$VERSION" | sed 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/')
334334
335335
git config user.name "github-actions[bot]"
336336
git config user.email "github-actions[bot]@users.noreply.github.com"

0 commit comments

Comments
 (0)