@@ -179,8 +179,12 @@ jobs:
179179 echo "::error::Failed to extract version from Cargo.toml"
180180 exit 1
181181 fi
182- # Strip prerelease suffix for macOS plist (Apple requires numeric-only)
183- PLIST_VERSION=$(echo "$VERSION" | sed 's/-.*//')
182+ # Strip prerelease and build metadata suffixes for macOS plist (Apple requires numeric-only)
183+ PLIST_VERSION=$(echo "$VERSION" | sed 's/[-+].*//')
184+ if ! echo "$PLIST_VERSION" | grep -Eq '^[0-9]+(\.[0-9]+){0,2}$'; then
185+ echo "::error::Invalid plist version '$PLIST_VERSION' derived from Cargo version '$VERSION'. Expected numeric x[.y[.z]]."
186+ exit 1
187+ fi
184188 echo "version=$VERSION" >> $GITHUB_OUTPUT
185189 echo "plist_version=$PLIST_VERSION" >> $GITHUB_OUTPUT
186190 echo "Extracted version: $VERSION (plist: $PLIST_VERSION)"
@@ -490,8 +494,12 @@ jobs:
490494 echo "::error::Failed to extract version from Cargo.toml"
491495 exit 1
492496 fi
493- # Strip prerelease suffix for macOS plist (Apple requires numeric-only)
494- PLIST_VERSION=$(echo "$VERSION" | sed 's/-.*//')
497+ # Strip prerelease and build metadata suffixes for macOS plist (Apple requires numeric-only)
498+ PLIST_VERSION=$(echo "$VERSION" | sed 's/[-+].*//')
499+ if ! echo "$PLIST_VERSION" | grep -Eq '^[0-9]+(\.[0-9]+){0,2}$'; then
500+ echo "::error::Invalid plist version '$PLIST_VERSION' derived from Cargo version '$VERSION'. Expected numeric x[.y[.z]]."
501+ exit 1
502+ fi
495503 echo "version=$VERSION" >> $GITHUB_OUTPUT
496504 echo "plist_version=$PLIST_VERSION" >> $GITHUB_OUTPUT
497505 echo "Extracted version: $VERSION (plist: $PLIST_VERSION)"
0 commit comments