mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-18 22:41:44 +02:00
Support deploy on all branches
This commit is contained in:
13
.travis.yml
13
.travis.yml
@@ -5,6 +5,7 @@ env:
|
|||||||
global:
|
global:
|
||||||
- OWNER=${TRAVIS_REPO_SLUG%/*}
|
- OWNER=${TRAVIS_REPO_SLUG%/*}
|
||||||
- DEV=${OWNER/oliexdev/dev}
|
- DEV=${OWNER/oliexdev/dev}
|
||||||
|
- BRANCH=${TRAVIS_BRANCH/master/}
|
||||||
|
|
||||||
android:
|
android:
|
||||||
components:
|
components:
|
||||||
@@ -29,7 +30,7 @@ before_script:
|
|||||||
-e 's/versionName "[^"]+/\0-'${DEV}'_'${TRAVIS_COMMIT:0:8}_$(date +%F)'/'
|
-e 's/versionName "[^"]+/\0-'${DEV}'_'${TRAVIS_COMMIT:0:8}_$(date +%F)'/'
|
||||||
android_app/app/build.gradle
|
android_app/app/build.gradle
|
||||||
- sed -i -r
|
- sed -i -r
|
||||||
-e 's/(<string name="app_name"[^>]*>[^<]+)/\1 ('${DEV}')/'
|
-e 's/(<string name="app_name"[^>]*>[^<]+)/\1 ('${DEV}${BRANCH}')/'
|
||||||
android_app/app/src/main/res/values/strings.xml
|
android_app/app/src/main/res/values/strings.xml
|
||||||
# Create keystore by running:
|
# Create keystore by running:
|
||||||
# keytool -genkey -v -keystore debug.keystore -storepass android \
|
# keytool -genkey -v -keystore debug.keystore -storepass android \
|
||||||
@@ -48,19 +49,19 @@ before_script:
|
|||||||
script: cd android_app && ./gradlew testDebug assembleAndroidTest assembleDebug
|
script: cd android_app && ./gradlew testDebug assembleAndroidTest assembleDebug
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- ln -s app/build/outputs/apk/debug/app-debug.apk openScale-${DEV}-build.apk
|
- ln -s app/build/outputs/apk/debug/app-debug.apk openScale-${DEV}${BRANCH}-build.apk
|
||||||
- git tag -f travis-${DEV}-build
|
- git tag -f travis-${DEV}${BRANCH}-build
|
||||||
- git remote add gh
|
- git remote add gh
|
||||||
https://${OWNER}:${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git
|
https://${OWNER}:${GITHUB_API_KEY}@github.com/${TRAVIS_REPO_SLUG}.git
|
||||||
- git push -f gh travis-${DEV}-build
|
- git push -f gh travis-${DEV}${BRANCH}-build
|
||||||
- git remote remove gh
|
- git remote remove gh
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
api-key: $GITHUB_API_KEY
|
api-key: $GITHUB_API_KEY
|
||||||
file: openScale-${DEV}-build.apk
|
file: openScale-${DEV}${BRANCH}-build.apk
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
name: openScale development build
|
name: openScale development build (${TRAVIS_BRANCH})
|
||||||
body: Automatic openScale development build of $TRAVIS_BRANCH
|
body: Automatic openScale development build of $TRAVIS_BRANCH
|
||||||
($TRAVIS_COMMIT) built by Travis CI on $(date +'%F %T %Z').
|
($TRAVIS_COMMIT) built by Travis CI on $(date +'%F %T %Z').
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
Reference in New Issue
Block a user