ci/android: publish package (wip)

This commit is contained in:
Arun Babu Neelicattu 2021-04-19 15:32:00 +02:00
parent e6d4729123
commit ee91e0acc5
2 changed files with 33 additions and 9 deletions

View file

@ -15,6 +15,7 @@ before_script:
- echo "ndk.dir=${ANDROID_NDK_HOME}" >> ./android/local.properties - echo "ndk.dir=${ANDROID_NDK_HOME}" >> ./android/local.properties
- cp -R $ANDROID_SDK_ROOT/licenses ./android/. - cp -R $ANDROID_SDK_ROOT/licenses ./android/.
- chmod +x ./android/gradlew - chmod +x ./android/gradlew
- pushd android
cache: cache:
key: ${CI_PROJECT_ID} key: ${CI_PROJECT_ID}
@ -23,10 +24,7 @@ cache:
build:android:aar: build:android:aar:
stage: build stage: build
tags:
- docker
script: script:
- pushd android
- ./gradlew clean assembleRelease - ./gradlew clean assembleRelease
artifacts: artifacts:
expire_in: 1 weeks expire_in: 1 weeks
@ -36,11 +34,16 @@ build:android:aar:
test:android:aar: test:android:aar:
stage: test stage: test
tags:
- docker
script: script:
- pushd android - echo "TODO fix this?"
# TODO: fix this?
# - ./gradlew test # - ./gradlew test
needs: needs:
- build:android:aar - build:android:aar
publish:android:aar:
stage: test
script:
- ./gradlew publish
needs:
- build:android:aar
- test:android:aar

View file

@ -13,6 +13,11 @@ buildscript {
} }
} }
plugins {
id 'java'
id 'maven-publish'
}
allprojects { allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
@ -20,6 +25,22 @@ allprojects {
} }
} }
task clean(type: Delete) { publishing {
delete rootProject.buildDir 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)
}
}
}
} }