Skip to content

Commit

Permalink
#Changed#
Browse files Browse the repository at this point in the history
git tag
  • Loading branch information
hui.zhao authored and hui.zhao committed Jan 22, 2020
1 parent 7fd5926 commit 59826bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ deploy:
file: "./app/build/outputs/apk/release/app-release.apk"
skip_cleanup: true
on:
tags: true
branch: master

after_success:
Expand Down
3 changes: 2 additions & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Deploy

1. update VERSION_NAME in gradle.properties(same as AndroidGodEye)
2. PUSH master,查看编译状态:[AndroidGodEyeDemo-travis-ci](https://travis-ci.org/Kyson/AndroidGodEyeDemo)
2. git tag VERSION_NAME
3. push master,查看编译状态:[AndroidGodEyeDemo-travis-ci](https://travis-ci.org/Kyson/AndroidGodEyeDemo)

## Keystore

Expand Down
13 changes: 11 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

String[] versionPart = String.valueOf(VERSION_NAME).split('\\.')
def realVersionName = VERSION_NAME
def TRAVIS_TAG = System.getenv("TRAVIS_TAG")
if (TRAVIS_TAG != null && "" != TRAVIS_TAG) {
realVersionName = TRAVIS_TAG
println "[VERSION] Version name is [" + realVersionName + "] by git tag."
} else {
println "[VERSION] Version name is [" + realVersionName + "] by gradle.properties."
}

String[] versionPart = String.valueOf(realVersionName).split('\\.')
int realVersionCode = Integer.valueOf(versionPart[0]) * 1000000 + Integer.valueOf(versionPart[1]) * 1000 + Integer.valueOf(versionPart[2])

ext {
REAL_VERSION_NAME = VERSION_NAME
REAL_VERSION_NAME = realVersionName
REAL_VERSION_CODE = realVersionCode
}

Expand Down

0 comments on commit 59826bf

Please sign in to comment.