forked from kaltura/playkit-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-push-to-bintray.sh
executable file
·41 lines (30 loc) · 1.15 KB
/
travis-push-to-bintray.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
#!/bin/bash
# Required env vars:
# TRAVIS_TAG: current tag (e.g. v0.1.2)
# BINTRAY_USER, BINTRAY_KEY
# Run locally:
# TRAVIS_TAG=v0.1.2 BINTRAY_USER=username BINTRAY_KEY=fjkhsdfka3289r82rkfe ./travis-push-to-bintray.sh
DRY_RUN=false
# Only allow tags
if [ -z "$TRAVIS_TAG" ]; then
echo "Not a Travis tag build; will perform a dry-run."
TRAVIS_TAG=v0.0.0
DRY_RUN=true
fi
# Strip the "v" prefix
TAG_VERSION_NAME=${TRAVIS_TAG:1}
# Only allow proper "digits.digits.digits" versions.
if [[ ! $TAG_VERSION_NAME =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Not a proper version string; will perform a dry-run."
DRY_RUN=true
fi
# Check that defined library version matches the tag.
if ! grep -q "ext.playkitVersion = '$TAG_VERSION_NAME'" playkit/version.gradle
then
echo "Library version name in build.gradle does not match tag name; will perform a dry-run."
DRY_RUN=true
fi
# Assuming a successful playkit:build, create javadoc jar, sources jar, pom
./gradlew playkit:publishMavenPublicationToMavenLocal -x mavenAndroidJavadocs
# Upload
./gradlew playkit:bintrayUpload -PdryRun=$DRY_RUN -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_KEY