forked from CloudyPadmal/pslab-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupload-apk.sh
36 lines (28 loc) · 1.1 KB
/
upload-apk.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
#!/usr/bin/env bash
#create a new directory that will contain out generated apk
mkdir $HOME/buildApk/
#copy generated apk from build folder and README.md to the folder just created
cp -R app/build/outputs/apk/app-debug.apk $HOME/buildApk/
cp -R README.md $HOME/buildApk/
#setup git
cd $HOME
git config --global user.email "[email protected]"
git config --global user.name "Travis CI"
#clone the repository in the buildApk folder
git clone --quiet --branch=apk https://fossasia:[email protected]/fossasia/pslab-android apk > /dev/null
cd apk
cp -Rf $HOME/buildApk/* ./
git checkout --orphan workaround
git add -A
#add files
#git add -f .
#commit and skip the tests
git commit -am "Travis build pushed [skip ci]"
git branch -D apk
git branch -m apk
#push to the branch apk
git push origin apk --force --quiet> /dev/null
if [ "$TRAVIS_PULL_REQUEST" == "false" ]
then
curl https://[email protected]/v1/apps/4eqye6ea422e5np0gp2jfpemgm -H 'Content-Type: application/json' -d '{"url":"https://github.com/fossasia/pslab-android/blob/apk/app-debug.apk", "note": "PSLab Android App Update"}'
fi