1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

CI: deploy: use env TRAVIS_PULL_REQUEST to condition deploy

This commit is contained in:
David Gauchard 2018-12-13 10:19:02 +01:00
parent dce8dce44f
commit e1eca80d28
2 changed files with 7 additions and 6 deletions

View File

@ -85,7 +85,8 @@ jobs:
stage: deploy
script: $TRAVIS_BUILD_DIR/tests/common.sh
env: BUILD_TYPE=package
if: env(CI_GITHUB_API_KEY) IS present
# TRAVIS_PULL_REQUEST is set to the pull request number if the current job is a pull request build, or false if its not.
if: env(TRAVIS_PULL_REQUEST) != "false"
deploy:
# Create Github release, upload artifacts
- provider: releases

View File

@ -124,14 +124,14 @@ fi
cat $srcdir/package/package_esp8266com_index.template.json | \
jq "$jq_arg" > package_esp8266com_index.json
# Use Github API token, if available
# Use Github API token, must be available
curl_gh_token_arg=()
if [ -z "$CI_GITHUB_API_KEY" ]; then
echo "curl: API key not present, exit with no error"
exit 0
else
curl_gh_token_arg=(-H "Authorization: token $CI_GITHUB_API_KEY")
echo "curl: API key not present, exit with error"
exit 1
fi
curl_gh_token_arg=(-H "Authorization: token $CI_GITHUB_API_KEY")
# Get previous release name
curl --silent -D /dev/stderr ${curl_gh_token_arg[@]} https://api.github.com/repos/esp8266/Arduino/releases > releases.json