diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 500ba17..e26a755 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ build arm64 aar: - bin/lbrysdk-*-release__arm64.aar expire_in: 1 week script: + - export NEXUS_SIGNING_KEYRING_FILE=$CI_PROJECT_DIR/signing.pgp - export PATH=/usr/bin:$PATH - wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/ - tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/ @@ -38,6 +39,7 @@ build arm aar: - bin/lbrysdk-*-release__arm.aar expire_in: 1 week script: + - export NEXUS_SIGNING_KEYRING_FILE=$CI_PROJECT_DIR/signing.pgp - export PATH=/usr/bin:$PATH - wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/ - tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/ diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/build.py b/p4a/pythonforandroid/bootstraps/lbry/build/build.py index 21da781..59857a9 100755 --- a/p4a/pythonforandroid/bootstraps/lbry/build/build.py +++ b/p4a/pythonforandroid/bootstraps/lbry/build/build.py @@ -404,7 +404,10 @@ main.py that loads it.''') android_api=android_api, build_tools_version=build_tools_version) - render('gradle.properties', 'gradle.properties') + render( + 'gradle.properties', + 'gradle.properties', + env=os.environ) # copy icon drawables for folder in ('drawable-hdpi', 'drawable-mdpi', 'drawable-xhdpi', 'drawable-xxhdpi', 'drawable-xxxhdpi'): diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle index 455e610..34d5198 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle +++ b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle @@ -3,11 +3,12 @@ buildscript { repositories { jcenter() google() + mavenCentral() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.4.2' - classpath 'com.novoda:bintray-release:0.9.2' + classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' } } @@ -24,7 +25,11 @@ allprojects { } apply plugin: 'com.android.library' -apply plugin: 'com.novoda.bintray-release' +apply plugin: 'com.bmuschko.nexus' + +archivesBaseName = 'lbrysdk' +group = "io.lbry" +version = "{{ args.version }}" android { compileSdkVersion {{ android_api }} @@ -96,15 +101,19 @@ subprojects { } } -publish { - userOrg = 'lbryio' - repoName = 'io.lbry' - groupId = 'io.lbry' - artifactId = 'lbrysdk64' - publishVersion = '{{args.version}}' - licences = ['MIT'] - desc = 'LBRY SDK packaged as Android AAR (64-bit)' - website = 'https://github.com/lbryio/lbry-android-sdk' +nexus { + sign = true + repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' +} + +modifyPom { + project { + name 'LBRY SDK for Android' + description 'The LBRY SDK packaged as an Android AAR' + groupId 'io.lbry' + artifactId 'lbrysdk64' + } } dependencies { diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm index 22e415f..b418f27 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm +++ b/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm @@ -3,11 +3,12 @@ buildscript { repositories { jcenter() google() + mavenCentral() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.4.2' - classpath 'com.novoda:bintray-release:0.9.2' + classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1' } } @@ -24,7 +25,11 @@ allprojects { } apply plugin: 'com.android.library' -apply plugin: 'com.novoda.bintray-release' +apply plugin: 'com.bmuschko.nexus' + +archivesBaseName = 'lbrysdk' +group = "io.lbry" +version = "{{ args.version }}" android { compileSdkVersion {{ android_api }} @@ -96,15 +101,19 @@ subprojects { } } -publish { - userOrg = 'lbryio' - repoName = 'io.lbry' - groupId = 'io.lbry' - artifactId = 'lbrysdk32' - publishVersion = '{{args.version}}' - licences = ['MIT'] - desc = 'LBRY SDK packaged as Android AAR (32-bit)' - website = 'https://github.com/lbryio/lbry-android-sdk' +nexus { + sign = true + repositoryUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + snapshotRepositoryUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' +} + +modifyPom { + project { + name 'LBRY SDK for Android' + description 'The LBRY SDK packaged as an Android AAR' + groupId 'io.lbry' + artifactId 'lbrysdk32' + } } dependencies { diff --git a/p4a/pythonforandroid/bootstraps/lbry/build/templates/gradle.properties b/p4a/pythonforandroid/bootstraps/lbry/build/templates/gradle.properties index d015431..f7a8396 100644 --- a/p4a/pythonforandroid/bootstraps/lbry/build/templates/gradle.properties +++ b/p4a/pythonforandroid/bootstraps/lbry/build/templates/gradle.properties @@ -1,2 +1,9 @@ android.useAndroidX=true -android.enableJetifier=true \ No newline at end of file +android.enableJetifier=true + +nexusUsername={{ env["SONATYPE_USERNAME"] }} +nexusPassword={{ env["SONATYPE_PASSWORD"] }} + +signing.keyId={{ env["NEXUS_SIGNING_KEY_ID"] }} +signing.password={{ env["NEXUS_SIGNING_KEY_PASSWORD"] }} +signing.secretKeyRingFile={{ env["NEXUS_SIGNING_KEYRING_FILE"] }} diff --git a/p4a/pythonforandroid/toolchain.py b/p4a/pythonforandroid/toolchain.py index be5e14a..a310723 100644 --- a/p4a/pythonforandroid/toolchain.py +++ b/p4a/pythonforandroid/toolchain.py @@ -865,9 +865,7 @@ class ToolchainCL(object): raise BuildInterruptingException( "Unknown build mode {} for apk()".format(args.build_mode)) output = shprint(gradlew, "--console=plain", gradle_task, - "bintrayUpload", - "-PdryRun=false", - "-Poverride=true", + "uploadArchives", _tail=20, _critical=True, _env=env) diff --git a/signing.pgp b/signing.pgp new file mode 100644 index 0000000..9f58bb2 Binary files /dev/null and b/signing.pgp differ