Skip to content

Commit

Permalink
Use environment variable to detect publishing state. (#834)
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zinnatullin committed Oct 16, 2017
1 parent 46ac214 commit 3c33219
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -30,7 +30,7 @@ after_success:

deploy:
- provider: script
script: ./ci.sh publish=true
script: PUBLISH_RELEASE=true ./ci.sh
skip_cleanup: true
on:
tags: true
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Expand Up @@ -197,6 +197,10 @@ def validateTagAndVersion() {
}

def isValidReleaseState() {
if ('true' != System.getenv('PUBLISH_RELEASE')) {
return false
}

try {
validateTagAndVersion()
return true
Expand Down
6 changes: 2 additions & 4 deletions ci.sh
Expand Up @@ -7,16 +7,14 @@ PROJECT_DIR="$DIR"

pushd "$PROJECT_DIR"

# Pass "publish=true" as first argument to initiate release process.
SHOULD_PUBLISH_RELEASE="$1"

# For some reason test for annotation processor are failing on a regular CI setup.
# So we had to exclude test task for it from the main build process and execute it as a separate command.
./gradlew clean build checkstyle -PdisablePreDex --exclude-task :storio-sqlite-annotations-processor-test:test --exclude-task :storio-content-resolver-annotations-processor-test:test
./gradlew :storio-sqlite-annotations-processor-test:test
./gradlew :storio-content-resolver-annotations-processor-test:test

if [ "$SHOULD_PUBLISH_RELEASE" == "publish=true" ]; then
# Export "PUBLISH_RELEASE=true" to initiate release process.
if [ "$PUBLISH_RELEASE" == "true" ]; then
echo "Launching release publishing process..."

if [ -z "$GPG_SECRET_KEYS" ]; then
Expand Down

0 comments on commit 3c33219

Please sign in to comment.