2019-06-01 18:51:33 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-06-07 00:25:43 +02:00
|
|
|
set -e
|
|
|
|
|
2019-06-07 23:58:23 +02:00
|
|
|
|
|
|
|
if [[ ${TRAVIS_REPO_SLUG} != 'vimeo/psalm' && -z ${PHAR_REPO_SLUG} ]]; then
|
|
|
|
echo 'Not attempting phar deployment, as this is not vimeo/psalm, and $PHAR_REPO_SLUG is unset or empty'
|
|
|
|
exit 0;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
PHAR_REPO_SLUG=${PHAR_REPO_SLUG:=psalm/phar}
|
|
|
|
|
|
|
|
git clone https://${GITHUB_TOKEN}@github.com/${PHAR_REPO_SLUG}.git phar > /dev/null 2>&1
|
|
|
|
|
|
|
|
set -x # don't do set x above this point to protect the GITHUB_TOKEN
|
|
|
|
|
2019-03-25 18:40:17 +01:00
|
|
|
cd phar
|
2019-06-07 14:18:58 +02:00
|
|
|
rm -rf *
|
2019-06-07 23:58:23 +02:00
|
|
|
cp ../build/psalm.phar ../assets/psalm-phar/* .
|
|
|
|
cp ../build/psalm.phar.asc || true # not all users have GPG keys
|
2019-06-07 00:12:53 +02:00
|
|
|
mv dot-gitignore .gitignore
|
2019-03-25 18:40:17 +01:00
|
|
|
git config user.email "travis@travis-ci.org"
|
|
|
|
git config user.name "Travis CI"
|
2019-06-07 00:12:53 +02:00
|
|
|
git add --all .
|
2019-03-25 18:40:17 +01:00
|
|
|
git commit -m "Updated Psalm phar to commit ${TRAVIS_COMMIT}"
|
2019-06-07 23:58:23 +02:00
|
|
|
git push --quiet origin master > /dev/null 2>&1
|
2019-06-01 16:25:26 +02:00
|
|
|
|
|
|
|
if [[ "$TRAVIS_TAG" != '' ]] ; then
|
|
|
|
git tag "$TRAVIS_TAG"
|
|
|
|
git push origin "$TRAVIS_TAG"
|
|
|
|
fi
|