File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,11 @@ check_stable() {
2626# Function to get the latest stable release tag for a PHP version.
2727get_stable_release_tag () {
2828 source=$1
29- if [ " $source " = " web-php" ]; then
30- curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 " php-($PHP_VERSION .[0-9]+)" | head -n 1
29+ if [ " $source " = " --web-php" ]; then
30+ release_tag=" $( curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 " php-(${php_version// ./ \\ .} \.[0-9]+)" | head -n 1) "
31+ [[ -z $release_tag ]] && echo " php-$( curl -sL https://www.php.net/releases | grep -Po -m 1 " ${php_version// ./ \\ .} \.[0-9]+" | head -n 1) " || echo " $release_tag "
3132 else
32- curl -H " Authorization: Bearer $GITHUB_TOKEN " -sL " https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$PHP_VERSION ." | grep -Eo " php-[0-9]+\.[0-9]+\.[0-9]+\" " | tail -1 | cut -d ' "' -f 1
33+ curl -H " Authorization: Bearer $GITHUB_TOKEN " -sL " https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$php_version ." | grep -Eo " php-[0-9]+\.[0-9]+\.[0-9]+\" " | tail -1 | cut -d ' "' -f 1
3334 fi
3435}
3536
Original file line number Diff line number Diff line change 33# Function to get the latest stable release tag for a PHP version.
44get_stable_release_tag () {
55 source=$1
6- if [ " $source " = " web-php" ]; then
7- echo " php-$( curl -sL https://www.php.net/releases | grep -Po -m 1 " $php_version \.[0-9]+" | head -n 1) "
6+ if [ " $source " = " --web-php" ]; then
7+ release_tag=" $( curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 " php-(${php_version// ./ \\ .} \.[0-9]+)" | head -n 1) "
8+ [[ -z $release_tag ]] && echo " php-$( curl -sL https://www.php.net/releases | grep -Po -m 1 " ${php_version// ./ \\ .} \.[0-9]+" | head -n 1) " || echo " $release_tag "
89 else
910 curl -H " Authorization: Bearer $GITHUB_TOKEN " -sL " https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$php_version ." | grep -Eo " php-[0-9]+\.[0-9]+\.[0-9]+\" " | tail -1 | cut -d ' "' -f 1
1011 fi
2122 for php_version in " ${php_versions_to_check[@]} " ; do
2223 # Fetch new and existing version, compare and add to php_versions_to_build array.
2324 # Here we only check for stable as both RC and nightly should be built.
24- existing_version=$( curl -sL https://github.com/shivammathur/php-builder/releases/download/" $php_version " /php" $php_version " .log
25- )
25+ existing_version=$( curl -sL https://github.com/shivammathur/php-builder/releases/download/" $php_version " /php" $php_version " .log)
2626 new_version=" $( get_stable_release_tag " $3 " ) "
2727 if [ " $new_version " != " $existing_version " ]; then
2828 php_versions_to_build+=(" $php_version " )
Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ log_build() {
1010# Function to get the latest stable release tag for a PHP version.
1111get_stable_release_tag () {
1212 source=$1
13- if [ " $source " = " web-php" ]; then
14- curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 " php-($PHP_VERSION .[0-9]+)" | head -n 1
13+ if [ " $source " = " --web-php" ]; then
14+ release_tag=" $( curl -sL https://www.php.net/releases/feed.php | grep -Po -m 1 " php-(${php_version// ./ \\ .} \.[0-9]+)" | head -n 1) "
15+ [[ -z $release_tag ]] && echo " php-$( curl -sL https://www.php.net/releases | grep -Po -m 1 " ${php_version// ./ \\ .} \.[0-9]+" | head -n 1) " || echo " $release_tag "
1516 else
16- curl -H " Authorization: Bearer $GITHUB_TOKEN " -sL " https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$PHP_VERSION ." | grep -Eo " php-[0-9]+\.[0-9]+\.[0-9]+\" " | tail -1 | cut -d ' "' -f 1
17+ curl -H " Authorization: Bearer $GITHUB_TOKEN " -sL " https://api.github.com/repos/php/php-src/git/matching-refs/tags%2Fphp-$php_version ." | grep -Eo " php-[0-9]+\.[0-9]+\.[0-9]+\" " | tail -1 | cut -d ' "' -f 1
1718 fi
1819}
1920
You can’t perform that action at this time.
0 commit comments