diff --git a/android/.gitlab-ci.yml b/android/.gitlab-ci.yml index 3bd3f93..e707158 100644 --- a/android/.gitlab-ci.yml +++ b/android/.gitlab-ci.yml @@ -15,6 +15,7 @@ before_script: - echo "ndk.dir=${ANDROID_NDK_HOME}" >> ./android/local.properties - cp -R $ANDROID_SDK_ROOT/licenses ./android/. - chmod +x ./android/gradlew + - pushd android cache: key: ${CI_PROJECT_ID} @@ -23,10 +24,7 @@ cache: build:android:aar: stage: build - tags: - - docker script: - - pushd android - ./gradlew clean assembleRelease artifacts: expire_in: 1 weeks @@ -36,11 +34,16 @@ build:android:aar: test:android:aar: stage: test - tags: - - docker script: - - pushd android - # TODO: fix this? + - echo "TODO fix this?" # - ./gradlew test needs: - build:android:aar + +publish:android:aar: + stage: test + script: + - ./gradlew publish + needs: + - build:android:aar + - test:android:aar diff --git a/android/build.gradle b/android/build.gradle index da25888..796fad0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -13,6 +13,11 @@ buildscript { } } +plugins { + id 'java' + id 'maven-publish' +} + allprojects { repositories { mavenCentral() @@ -20,6 +25,22 @@ allprojects { } } -task clean(type: Delete) { - delete rootProject.buildDir +publishing { + publications { + library(MavenPublication) { + from components.java + } + } + repositories { + maven { + url "https://gitlab.matrix.org/api/v4/projects/27/packages/maven" + credentials(HttpHeaderCredentials) { + name = 'Job-Token' + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + header(HttpHeaderAuthentication) + } + } + } }