Skip to content

Commit d2dd016

Browse files
committed
get package tag version from binary instead
1 parent ee39475 commit d2dd016

1 file changed

Lines changed: 2 additions & 19 deletions

File tree

build-packages.sh

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,8 @@ if [ ! -f "dist/$bin" ]; then
3131
exit 1
3232
fi
3333

34-
if [ -z "${FRANKENPHP_VERSION}" ]; then
35-
FRANKENPHP_VERSION="$(git rev-parse --verify HEAD)"
36-
export FRANKENPHP_VERSION
37-
elif [ -d ".git/" ]; then
38-
CURRENT_REF="$(git rev-parse --abbrev-ref HEAD)"
39-
export CURRENT_REF
40-
41-
if echo "${FRANKENPHP_VERSION}" | grep -F -q "."; then
42-
# Tag
43-
44-
# Trim "v" prefix if any
45-
FRANKENPHP_VERSION=${FRANKENPHP_VERSION#v}
46-
export FRANKENPHP_VERSION
47-
48-
git checkout "v${FRANKENPHP_VERSION}"
49-
else
50-
git checkout "${FRANKENPHP_VERSION}"
51-
fi
52-
fi
34+
version_output="$(dist/"$bin" version)"
35+
FRANKENPHP_VERSION=$(echo "$version_output" | grep -oP 'FrankenPHP\s+\K[0-9]+\.[0-9]+\.[0-9]+' || true)
5336

5437
if [[ ! "${FRANKENPHP_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
5538
echo "Warning: FRANKENPHP_VERSION must be set to X.Y.Z (e.g. 1.5.1), got '${FRANKENPHP_VERSION}'"

0 commit comments

Comments
 (0)