forked from syncthing/syncthing-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-release.sh
executable file
·60 lines (44 loc) · 1.18 KB
/
publish-release.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -e
version=$(git describe --always)
regex='^[0-9]+\.[0-9]+\.[0-9]+$'
if [[ ! ${version} =~ $regex ]]
then
echo "Current commit is not a release"
exit;
fi
echo "
Pushing to Github
-----------------------------
"
git push
git push --tags
version=`git describe --tags --abbrev=0`
echo "
Enter Changelog for $version
-----------------------------
"
changelog_file="build/changelog.tmp"
touch ${changelog_file}
nano ${changelog_file}
changelog=`cat ${changelog_file}`
mv ${changelog_file} "src/main/play/en-GB/whatsnew"
echo "
Push to Google Play
-----------------------------
"
read -s -p "Enter signing password: " password
SIGNING_PASSWORD=$password ./gradlew assembleRelease
# Upload apk and listing to Google Play
SIGNING_PASSWORD=$password ./gradlew publishRelease
echo "
Release published!
"
#echo "
#
#Create Github Release
#-----------------------------
#"
#ACCESS_TOKEN=""
#api_json=$(printf '{"tag_name": "v%s","target_commitish": "master","name": "v%s","body": "%s","draft": false,"prerelease": false}' $version $version $changelog)
#curl --data "$api_json" https://api.github.com/repos/syncthing/syncthing-android/releases?access_token=$ACCESS_TOKEN