ci/android: publish package (wip)

ci/pipeline-publish
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
- 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

View File

@ -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)
}
}
}
}