mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix scripts and action workflow
This commit is contained in:
parent
a0b0e58cb3
commit
36104f0983
6
.github/workflows/workflow.yml
vendored
6
.github/workflows/workflow.yml
vendored
@ -1,9 +1,5 @@
|
|||||||
name: Main workflow
|
name: Main workflow
|
||||||
on:
|
on: [push]
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- '*'
|
|
||||||
- '!*.md'
|
|
||||||
jobs:
|
jobs:
|
||||||
run:
|
run:
|
||||||
name: Run
|
name: Run
|
||||||
|
@ -1,28 +1,11 @@
|
|||||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
||||||
brew tap exolnet/homebrew-deprecated > /dev/null 2>&1;
|
brew tap exolnet/homebrew-deprecated > /dev/null 2>&1
|
||||||
brew install php@"$1";
|
brew install php@"$1" composer
|
||||||
brew link --force --overwrite php@"$1";
|
brew link --force --overwrite php@"$1"
|
||||||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
ext_dir=$(/usr/bin/php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
ext_dir=$(/usr/bin/php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
||||||
sudo chmod 777 "$ini_file"
|
sudo chmod 777 "$ini_file"
|
||||||
mkdir -p "$(pecl config-get ext_dir)"
|
mkdir -p "$(pecl config-get ext_dir)"
|
||||||
if [ ! -e "/usr/bin/composer" ]; then
|
|
||||||
EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)"
|
|
||||||
curl -s -L https://getcomposer.org/installer > composer-setup.php
|
|
||||||
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
|
||||||
|
|
||||||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
|
|
||||||
>&2 echo 'ERROR: Invalid installer signature'
|
|
||||||
rm composer-setup.php
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
COMPOSER_ALLOW_SUPERUSER=1
|
|
||||||
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
|
||||||
RESULT=$?
|
|
||||||
rm composer-setup.php
|
|
||||||
exit $RESULT
|
|
||||||
fi
|
|
||||||
composer global require hirak/prestissimo
|
composer global require hirak/prestissimo
|
||||||
php -v
|
php -v
|
||||||
composer -V
|
composer -V
|
||||||
|
14
src/linux.sh
14
src/linux.sh
@ -18,16 +18,12 @@ if [ ! -e "/usr/bin/composer" ]; then
|
|||||||
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
|
||||||
|
|
||||||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
|
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
|
||||||
>&2 echo 'ERROR: Invalid installer signature'
|
>&2 echo 'ERROR: Invalid installer signature'
|
||||||
rm composer-setup.php
|
else
|
||||||
exit 1
|
COMPOSER_ALLOW_SUPERUSER=1
|
||||||
|
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||||
fi
|
fi
|
||||||
|
rm composer-setup.php
|
||||||
COMPOSER_ALLOW_SUPERUSER=1
|
|
||||||
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
|
||||||
RESULT=$?
|
|
||||||
rm composer-setup.php
|
|
||||||
exit $RESULT
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
composer global require hirak/prestissimo > /dev/null 2>&1
|
composer global require hirak/prestissimo > /dev/null 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user