Skip to content

Commit 7a10d23

Browse files
authored
chore: add snapshot publish to travis (#380)
1 parent 8a3861c commit 7a10d23

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

.travis.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ env:
88
- ANDROID_API=29 # api is same as gradle file
99
- ANDROID_BUILD_TOOLS=29.0.3 # should match gradle
1010
- ADB_INSTALL_TIMEOUT=5 # minutes
11-
matrix:
11+
- ANDROID_TAG=google_apis
12+
- ANDROID_ABI=armeabi-v7a
13+
jobs:
1214
# API 26+ supports "x86" (ANDROID_ABI=x86) emulators only, which are not supported yet in travis VMs
1315
# so API 24 is the highest level we can run with emulator for now
14-
- EMULATOR_API=19 ANDROID_TAG=google_apis ANDROID_ABI=armeabi-v7a # API-16 build fails in travis
15-
- EMULATOR_API=21 ANDROID_TAG=google_apis ANDROID_ABI=armeabi-v7a
16-
- EMULATOR_API=24 ANDROID_TAG=google_apis ANDROID_ABI=armeabi-v7a
16+
- EMULATOR_API=19 # API-16 build fails in travis
17+
- EMULATOR_API=21
18+
- EMULATOR_API=24
1719

1820
android:
1921
components:
@@ -56,7 +58,8 @@ stages:
5658
- 'Integration tests'
5759
- 'Test'
5860
- 'Publish'
59-
61+
- 'Snapshot'
62+
6063
jobs:
6164
include:
6265
- stage: 'Lint markdown files'
@@ -103,3 +106,8 @@ jobs:
103106
after_script: skip
104107
after_success: skip
105108

109+
- stage: 'Snapshot'
110+
if: env(SNAPSHOT) = true and type = api
111+
script:
112+
- TRAVIS_TAG=BB-SNAPSHOT ./gradlew ship
113+
after_success: skip

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ buildscript {
2323
if (version_name != null) {
2424
rootProject.ext.version_name = version_name
2525
} else {
26-
rootProject.ext.version_name= 'debugVersion'
26+
rootProject.ext.version_name = 'debugVersion'
2727
}
28+
ext.is_release_version = !rootProject.ext.version_name.endsWith("SNAPSHOT")
29+
2830
repositories {
2931
jcenter()
3032
google()
@@ -191,7 +193,9 @@ configure(publishedProjects) {
191193
}
192194
repositories {
193195
maven {
194-
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
196+
def releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
197+
def snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots"
198+
url = is_release_version ? releaseUrl : snapshotUrl
195199
credentials {
196200
username System.getenv('MAVEN_CENTRAL_USERNAME')
197201
password System.getenv('MAVEN_CENTRAL_PASSWORD')

0 commit comments

Comments
 (0)