Merge pull request #40 from stevesoltys/feature/prebuilt-repo
Add support for automatic prebuilt repo deployments
This commit is contained in:
commit
e09ccb43e1
4 changed files with 34 additions and 30 deletions
16
.travis.yml
16
.travis.yml
|
@ -20,7 +20,7 @@ before_cache:
|
||||||
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
|
||||||
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
|
||||||
|
|
||||||
script: ./gradlew check
|
script: ./gradlew check assemble
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -29,14 +29,10 @@ cache:
|
||||||
- $HOME/.android/build-cache
|
- $HOME/.android/build-cache
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: script
|
||||||
api_key:
|
script: ./deploy-prebuilt.sh
|
||||||
secure: BJ+0riccbDPQMcvZkYveHHcSa3wlVRdvLIHMJtZQXmjJnYu4Mh2YH4RkZdd+4OBPf2iBCyP1CIxB9NTKldb8Qn1m/6+LcReYf2xd8Y6XCrHDsycT5GZTENEif0EyVPdB1En4NwRVYiNwGMSv49Cz03aGtzq5jrGWxPhYAEY4jt86HKRqw8SCUPEqug3Rz+deG4juUdIAvARiN8jKoqu9EeMOP5ST7nbZjZQbee8SGP7wPW+J7E6kWPvn+mSoZsMXw/ELz8nEAu4pHh/98agreMvApjImpiEpVXNhMpENfk42U+wztiGNspoOh/vDFrNikWFGIJ3lE4yPJteBo2vpVo/7/tfBzKjMnL7c/5ZNMnjv9e2yoqwfpwmh8GzjKaDuwG1Fy8g5ctJAS4wYHr4z4LDlfdmFVUE3r3NPI8XdzsnjVpqkXhC/5eBPO50p82c0Za24SwkmO+JzIaIF41fTt0An9Dd/1Q5321WGJK6HqQwdjRG3HciLF6lNJu/gzSVHnfC9REQGY7vDdNSVaP9ps0W07URewsKwC5Vm5SFYUEFIM2d3C+62+eciqlpfqON6htd9zAZnFTSE6rMTJdGXMs+hLb89C1J3tavz89T2d9Dqnvs6MlKEO3ontDcwYdbx8czPKv22Fm4iI4XG6VTzK9hS4BNCvhvyvqSq7mYIXsA=
|
skip_cleanup: true
|
||||||
file:
|
|
||||||
- app/build/outputs/apk/release/app-release-unsigned.apk
|
|
||||||
- app/src/main/permissions_com.stevesoltys.backup.xml
|
|
||||||
- app/src/main/whitelist_com.stevesoltys.backup.xml
|
|
||||||
on:
|
on:
|
||||||
repo: stevesoltys/backup
|
repo: stevesoltys/backup
|
||||||
tags: true
|
all_branches: true
|
||||||
skip_cleanup: true
|
condition: $TRAVIS_BRANCH =~ ^(master|develop)$
|
||||||
|
|
|
@ -17,12 +17,6 @@ LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
||||||
include $(BUILD_PREBUILT)
|
include $(BUILD_PREBUILT)
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
backup_root := $(LOCAL_PATH)
|
|
||||||
|
|
||||||
$(backup_root)/Backup.apk:
|
|
||||||
cd $(backup_root) && ./download.sh
|
|
||||||
|
|
||||||
LOCAL_MODULE := Backup
|
LOCAL_MODULE := Backup
|
||||||
LOCAL_SRC_FILES := Backup.apk
|
LOCAL_SRC_FILES := Backup.apk
|
||||||
LOCAL_CERTIFICATE := platform
|
LOCAL_CERTIFICATE := platform
|
||||||
|
|
28
deploy-prebuilt.sh
Executable file
28
deploy-prebuilt.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Script to deploy to a prebuilt repo.
|
||||||
|
|
||||||
|
REPO_URL="https://stevesoltys:$GITHUB_API_KEY@github.com/stevesoltys/backup-prebuilt"
|
||||||
|
TAG=$(git tag -l --points-at HEAD)
|
||||||
|
|
||||||
|
git config --global user.email "github@stevesoltys.com"
|
||||||
|
git config --global user.name "Steve Soltys"
|
||||||
|
git clone --quiet $REPO_URL
|
||||||
|
|
||||||
|
cd backup-prebuilt
|
||||||
|
git checkout $TRAVIS_BRANCH || git checkout -b $TRAVIS_BRANCH
|
||||||
|
rm -Rf ./*
|
||||||
|
cp $TRAVIS_BUILD_DIR/Android.mk .
|
||||||
|
cp $TRAVIS_BUILD_DIR/app/build/outputs/apk/release/app-release-unsigned.apk ./Backup.apk
|
||||||
|
cp $TRAVIS_BUILD_DIR/permissions_com.stevesoltys.backup.xml .
|
||||||
|
cp $TRAVIS_BUILD_DIR/whitelist_com.stevesoltys.backup.xml .
|
||||||
|
cp $TRAVIS_BUILD_DIR/default-permissions_com.stevesoltys.backup.xml .
|
||||||
|
|
||||||
|
git add .
|
||||||
|
git commit -m "Travis build $TRAVIS_BUILD_NUMBER"
|
||||||
|
git push origin $TRAVIS_BRANCH
|
||||||
|
|
||||||
|
if [ ! -z ${TAG} ]; then
|
||||||
|
git tag ${TAG}
|
||||||
|
git push origin --tags
|
||||||
|
fi
|
14
download.sh
14
download.sh
|
@ -1,14 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# Script to download apk from github releases
|
|
||||||
|
|
||||||
BASE_URL="https://github.com/stevesoltys/backup/releases"
|
|
||||||
APK="app-release-unsigned.apk"
|
|
||||||
VERSION="latest/download"
|
|
||||||
TAG=$(git tag -l --points-at HEAD)
|
|
||||||
|
|
||||||
if [ ! -z ${TAG} ]; then
|
|
||||||
VERSION="download/${TAG}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
curl -L ${BASE_URL}/${VERSION}/${APK} > Backup.apk
|
|
Loading…
Reference in a new issue