Skip to content

Commit 88dba2a

Browse files
committed
Switch to use latest git tag for Xdebug
1 parent de72a2b commit 88dba2a

File tree

8 files changed

+44
-6
lines changed

8 files changed

+44
-6
lines changed

config/extensions/8.0

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pecl pcov
1111
pecl redis
1212
pecl sqlsrv-5.11.1
1313
pecl pdo_sqlsrv-5.11.1
14-
pecl xdebug
1514
pecl yaml
1615
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
16+
git xdebug https://github.com/xdebug/xdebug latest
1717
git zmq https://github.com/zeromq/php-zmq master

config/extensions/8.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pecl pcov
1111
pecl redis
1212
pecl sqlsrv
1313
pecl pdo_sqlsrv
14-
pecl xdebug
1514
pecl yaml
1615
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
16+
git xdebug https://github.com/xdebug/xdebug latest
1717
git zmq https://github.com/zeromq/php-zmq master

config/extensions/8.2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pecl redis
1212
pecl sqlsrv
1313
pecl pdo_sqlsrv
1414
pecl yaml
15-
pecl xdebug
1615
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
16+
git xdebug https://github.com/xdebug/xdebug latest
1717
git zmq https://github.com/zeromq/php-zmq master

config/extensions/8.3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ pecl redis
1212
pecl sqlsrv
1313
pecl pdo_sqlsrv
1414
pecl yaml
15-
pecl xdebug
1615
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
16+
git xdebug https://github.com/xdebug/xdebug latest
1717
git zmq https://github.com/zeromq/php-zmq master

config/extensions/8.4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pecl pcov
1111
pecl redis
1212
pecl sqlsrv
1313
pecl pdo_sqlsrv
14-
pecl xdebug
1514
pecl yaml
1615
git imap https://github.com/php/pecl-mail-imap main --with-imap=shared,/usr --with-kerberos --with-imap-ssl=/usr
16+
git xdebug https://github.com/xdebug/xdebug latest
1717
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
1818
git zmq https://github.com/zeromq/php-zmq master

config/extensions/8.5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ pecl pcov
1010
pecl redis
1111
pecl sqlsrv
1212
pecl pdo_sqlsrv
13-
pecl xdebug
1413
pecl yaml
1514
git imap https://github.com/php/pecl-mail-imap main --with-imap=shared,/usr --with-kerberos --with-imap-ssl=/usr
15+
git xdebug https://github.com/xdebug/xdebug latest
1616
git memcached https://github.com/php-memcached-dev/php-memcached master --enable-memcached --enable-memcached-igbinary --enable-memcached-json --enable-memcached-msgpack
1717
git zmq https://github.com/zeromq/php-zmq master

scripts/install-extension.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,42 @@ params=("$@")
99

1010
. scripts/patch-extensions.sh
1111

12+
get_latest_git_tag() {
13+
local repo_url="$1"
14+
local repo_slug repo_owner repo_name latest_tag graph_query
15+
16+
if ! command -v gh >/dev/null 2>&1; then
17+
echo "GitHub CLI (gh) is required to resolve latest tags" >&2
18+
exit 1
19+
fi
20+
21+
repo_slug="$(echo "$repo_url" | sed -E 's|^https?://github.com/||; s|^[email protected]:||; s|\.git$||; s|/$||')"
22+
if [[ -z "$repo_slug" || "$repo_slug" = "$repo_url" || "$repo_slug" != */* ]]; then
23+
echo "Unsupported repository URL: $repo_url" >&2
24+
exit 1
25+
fi
26+
27+
repo_owner="${repo_slug%%/*}"
28+
repo_name="${repo_slug##*/}"
29+
graph_query='query($owner:String!,$name:String!){repository(owner:$owner,name:$name){refs(refPrefix:"refs/tags/",first:1,orderBy:{field:TAG_COMMIT_DATE,direction:DESC}){nodes{name}}}}'
30+
31+
latest_tag=$(gh api graphql -f owner="$repo_owner" -f name="$repo_name" -f query="$graph_query" --jq '.data.repository.refs.nodes[0].name' 2>/dev/null || true)
32+
if [ -z "$latest_tag" ]; then
33+
latest_tag=$(gh release list --repo "$repo_slug" --limit 1 --json tagName --jq '.[0].tagName' 2>/dev/null || true)
34+
fi
35+
36+
if [ -z "$latest_tag" ]; then
37+
echo "Could not determine latest tag for $repo_url" >&2
38+
exit 1
39+
fi
40+
41+
printf '%s' "$latest_tag"
42+
}
43+
44+
if [[ "$repo" != "pecl" && "$tag" = "latest" ]]; then
45+
tag="$(get_latest_git_tag "$repo")"
46+
fi
47+
1248
# Fetch the extension source.
1349
if [ "$repo" = "pecl" ]; then
1450
if [ -n "${tag// }" ]; then

scripts/install-requirements.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ if [ "${BUILD:?}" = "debug" ]; then
207207
sed -i '2s/main$/main\/debug/' /etc/apt/sources.list.d/ondrej-*.list
208208
apt-get update
209209
fi
210+
add_list github/cli https://cli.github.com/packages https://cli.github.com/packages/githubcli-archive-keyring.gpg stable
210211

211212
# Install PHP build requirements.
212213
install_packages apache2 \
@@ -217,6 +218,7 @@ install_packages apache2 \
217218
dpkg-dev \
218219
firebird-dev \
219220
freetds-dev \
221+
gh \
220222
libapparmor-dev \
221223
libacl1-dev \
222224
libaio-dev \

0 commit comments

Comments
 (0)