1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 12:24:49 +01:00
psalm/bin/travis-deploy-phar.sh

32 lines
902 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
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
rm -rf *
cp ../build/psalm.phar ../assets/psalm-phar/* .
cp ../build/psalm.phar.asc || true # not all users have GPG keys
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"
git add --all .
2019-03-25 18:40:17 +01:00
git commit -m "Updated Psalm phar to commit ${TRAVIS_COMMIT}"
git push --quiet origin master > /dev/null 2>&1
if [[ "$TRAVIS_TAG" != '' ]] ; then
git tag "$TRAVIS_TAG"
git push origin "$TRAVIS_TAG"
fi