-
Notifications
You must be signed in to change notification settings - Fork 0
/
commit.sh
executable file
·36 lines (30 loc) · 1.18 KB
/
commit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
if [[ "$TRAVIS_BRANCH" = "master" && "$TRAVIS_PULL_REQUEST" = "false" ]]; then
set -e
git config --global user.email "build@travis-ci.com"
git config --global user.name "Travis CI"
git remote add release "https://$GH_TOKEN@github.com/kaloglu/Duels.git"
git checkout $TRAVIS_BRANCH
file="./app/version.properties"
if [[ -f "$file" ]]; then
while IFS='=' read -r key value
do
key=$(echo ${key} | tr '.' '_')
eval ${key}=\$value
done < "$file"
echo "major = " ${VERSION_MAJOR}
echo "minor = " ${VERSION_MINOR}
echo "patch = " ${VERSION_PATCH}
else
echo "$file not found."
fi
version=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
git log $(git describe --tags --abbrev=0)..HEAD --oneline > beta_release_notes.txt
./gradlew postBeta
./gradlew clean assembleFirebaseBeta crashlyticsUploadDistributionFirebaseBeta
git add . -u
git commit -m "[ci skip] ${version}"
git push -f release $TRAVIS_BRANCH 2>&1
git tag beta/${version} -a -m "[ci tagging] beta/${version}"
git push -f release $TRAVIS_BRANCH --tags 2>&1
fi