From e6f4f27498fef5ee0d8499eb88f18434639c4912 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Sat, 1 Jun 2019 19:51:33 +0300 Subject: [PATCH] Simplify build config by using repo filter Also deploy signature to psalm/phar repo (because why not) --- .travis.yml | 11 ++++++++--- bin/travis-deploy-phar.sh | 6 ++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a1a9cc0c..d1159fbe5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,22 +62,27 @@ jobs: script: - vendor/bin/phpcs - # always build phar, but only deploy on tag builds - stage: Phar build php: 7.3 env: DEPS="high" script: bin/build-phar.sh deploy: + # deploy tagged releases to github releases page - provider: releases skip_cleanup: true on: tags: true - condition: ' "$GITHUB_TOKEN" != "" ' + repo: vimeo/psalm api_key: $GITHUB_TOKEN file: - build/psalm.phar - build/psalm.phar.asc + + # deploy built phar to github.com/psalm/phar repo for all branches and tags, + # but not for pull requests - provider: script skip_cleanup: true - condition: ' "$TRAVIS_PULL_REQUEST" = "false" && "$GITHUB_TOKEN" != "" ' + on: + repo: vimeo/psalm + condition: ' "$TRAVIS_PULL_REQUEST" = "false" ' script: bin/travis-deploy-phar.sh diff --git a/bin/travis-deploy-phar.sh b/bin/travis-deploy-phar.sh index ea707a37c..b4071073d 100755 --- a/bin/travis-deploy-phar.sh +++ b/bin/travis-deploy-phar.sh @@ -1,9 +1,11 @@ +#!/usr/bin/env bash + git clone https://${GITHUB_TOKEN}@github.com/psalm/phar.git > /dev/null 2>&1 -cp build/psalm.phar phar/psalm.phar +cp build/psalm.phar build/psalm.phar.asc phar/ cd phar git config user.email "travis@travis-ci.org" git config user.name "Travis CI" -git add psalm.phar +git add psalm.phar psalm.phar.asc git commit -m "Updated Psalm phar to commit ${TRAVIS_COMMIT}" git push --quiet origin master