GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — - adjust build setup to directly publish to sonatype · Candlewhacked/AboutLibraries@febbdae

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • ci.yml
  • build.gradle
  • gradle-release.gradle
  • library-core
    • build.gradle
  • library-definitions
    • build.gradle
  • library
    • build.gradle
  • release.sh
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
+13-7Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,23 @@ jobs:
9191
cd plugin-build
9292
./gradlew publishPlugins | true
9393
94-
- name: Release bintray
94+
- name: Prepare Sonatype Gradle properties
95+
if: startsWith(github.ref, 'refs/tags/')
96+
run: |
97+
echo "${{ secrets.SONATYPE_GPG_FILE }}" > opensource.gpg.asc
98+
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch "opensource.gpg.asc" > "$HOME/.gradle/opensource.gpg"
99+
echo "sonatype.gpg.key=${{ secrets.SONATYPE_GPG_KEY }}" >> ~/.gradle/gradle.properties
100+
echo "sonatype.gpg.password=${{ secrets.SONATYPE_GPG_PASS }}" >> ~/.gradle/gradle.properties
101+
echo "sonatype.gpg.secretKeyRingFile=$HOME/.gradle/opensource.gpg" >> ~/.gradle/gradle.properties
102+
103+
- name: Release Sonatype
95104
if: startsWith(github.ref, 'refs/tags/')
96105
run: |
97106
./gradlew build -x test -x lint
98-
./gradlew library-core:bintrayUpload -Plibrary_core_only --no-configure-on-demand --no-parallel
99-
./gradlew library:bintrayUpload -x test -x lint -Plibrary_only --no-configure-on-demand --no-parallel
100-
./gradlew library-definitions:bintrayUpload -x test -x lint -Plibrary_definitions_only --no-configure-on-demand --no-parallel
107+
./gradlew library-core:publishReleasePublicationToSonatypeRepository -Plibrary_core_only --no-configure-on-demand --no-parallel
108+
./gradlew library:publishReleasePublicationToSonatypeRepository -x test -x lint -Plibrary_only --no-configure-on-demand --no-parallel
109+
./gradlew library-definitions:publishReleasePublicationToSonatypeRepository -x test -x lint -Plibrary_definitions_only --no-configure-on-demand --no-parallel
101110
env:
102-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
103-
BINTRAY_API_KEY: ${{ secrets.BINTRAY_API_KEY }}
104-
BINTRAY_GPG_PASS: ${{ secrets.BINTRAY_GPG_PASS }}
105111
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
106112
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
107113

Collapse file

‎build.gradle‎

Copy file name to clipboardExpand all lines: build.gradle
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ buildscript {
3939
}
4040
dependencies {
4141
classpath 'com.android.tools.build:gradle:4.1.2'
42-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
43-
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
4442
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
4543
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:${versions.navigation}"
4644
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions.detekt}"
@@ -59,7 +57,7 @@ allprojects {
5957
}
6058

6159
subprojects {
62-
apply from: '../detekt.gradle'
60+
apply from: "$rootDir/detekt.gradle"
6361

6462
dependencies {
6563
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:${versions.detekt}"
Collapse file

‎gradle-release.gradle‎

Copy file name to clipboard
+28-77Lines changed: 28 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
@SuppressWarnings(["GroovyUnusedDeclaration", "GrMethodMayBeStatic"])
2-
def isReleaseBuild() {
3-
return !VERSION_NAME.contains("SNAPSHOT")
4-
}
1+
apply plugin: 'maven-publish'
2+
apply plugin: 'signing'
3+
4+
ext["signing.keyId"] = project.hasProperty('sonatype.gpg.key') ? project.property('sonatype.gpg.key') : System.getenv('SONATYPE_GPG_KEY')
5+
ext["signing.password"] = project.hasProperty('sonatype.gpg.password') ? project.property('sonatype.gpg.password') : System.getenv('SONATYPE_GPG_PASS')
6+
ext["signing.secretKeyRingFile"] = project.hasProperty('sonatype.gpg.secretKeyRingFile') ? project.property('sonatype.gpg.secretKeyRingFile') : System.getenv('SONATYPE_GPG_FILE')
57

68
@SuppressWarnings("GroovyUnusedDeclaration")
79
def getRepositoryUsername() {
@@ -13,12 +15,7 @@ def getRepositoryPassword() {
1315
return project.hasProperty('NEXUS_PASSWORD') ? project.property('NEXUS_PASSWORD') : System.getenv('NEXUS_PASSWORD')
1416
}
1517

16-
apply plugin: "com.jfrog.bintray"
17-
1818
afterEvaluate { project ->
19-
apply plugin: 'maven-publish'
20-
apply plugin: 'com.github.dcendents.android-maven'
21-
2219
if (JavaVersion.current().isJava8Compatible()) {
2320
allprojects {
2421
tasks.withType(Javadoc) {
@@ -43,60 +40,6 @@ afterEvaluate { project ->
4340
from android.sourceSets.main.java.source
4441
}
4542

46-
bintray {
47-
dryRun = false
48-
publish = true
49-
override = true
50-
user = project.hasProperty('bintray.user') ? project.property('bintray.user') : System.getenv('BINTRAY_USER')
51-
key = project.hasProperty('bintray.apikey') ? project.property('bintray.apikey') : System.getenv('BINTRAY_API_KEY')
52-
def gpgkey = project.hasProperty('bintray.gpg.key') ? project.property('bintray.gpg.key') : System.getenv('BINTRAY_GPG_KEY')
53-
def gpgpass = project.hasProperty('bintray.gpg.password') ? project.property('bintray.gpg.password') : System.getenv('BINTRAY_GPG_PASS')
54-
def versionName = project.release.versionName
55-
56-
publications('release')
57-
58-
pkg {
59-
publish = true
60-
61-
repo = "maven"
62-
name = GROUP + ":" + POM_ARTIFACT_ID //the name (= identifier) on bintray
63-
desc = POM_DESCRIPTION
64-
65-
websiteUrl = POM_URL
66-
issueTrackerUrl = POM_SCM_URL_ISSUES
67-
vcsUrl = POM_SCM_URL
68-
69-
githubRepo = POM_GITHUB_REPO
70-
githubReleaseNotesFile = POM_GITHUB_README
71-
72-
publicDownloadNumbers = true
73-
licenses = ["Apache-2.0"]
74-
version {
75-
name = versionName
76-
vcsTag = versionName
77-
released = new Date()
78-
79-
mavenCentralSync {
80-
sync = true
81-
user = getRepositoryUsername()
82-
password = getRepositoryPassword()
83-
close = '0'
84-
}
85-
gpg {
86-
sign = true
87-
passphrase = gpgpass
88-
}
89-
}
90-
}
91-
}
92-
93-
ext.addDependency = { dependencyNode, group, name, version ->
94-
dependencyNode.appendNode('groupId', group)
95-
dependencyNode.appendNode('artifactId', name)
96-
dependencyNode.appendNode('version', version)
97-
dependencyNode.appendNode('scope', "compile")
98-
}
99-
10043
def pomConfig = {
10144
licenses {
10245
license {
@@ -122,32 +65,40 @@ afterEvaluate { project ->
12265
publishing {
12366
publications {
12467
release(MavenPublication) {
68+
from components.release
69+
12570
groupId GROUP
12671
artifactId POM_ARTIFACT_ID
127-
version project.release.versionName
128-
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
72+
version android.defaultConfig.versionName
73+
12974
artifact androidSourcesJar
13075
artifact androidJavadocsJar
13176

13277
pom.withXml {
13378
asNode().appendNode('name', POM_NAME)
13479
asNode().appendNode('description', POM_DESCRIPTION)
13580
asNode().appendNode('url', POM_SCM_URL)
136-
def dependenciesNode = asNode().appendNode('dependencies')
137-
configurations.implementation.allDependencies.each {
138-
// Ensure dependencies such as fileTree are not included.
139-
if (it.name != 'unspecified') {
140-
def dependencyNode = dependenciesNode.appendNode('dependency')
141-
if (it.version != "unspecified") {
142-
addDependency(dependencyNode, it.group, it.name, it.version)
143-
} else {
144-
addDependency(dependencyNode, it.getDependencyProject().findProperty("GROUP"), it.getDependencyProject().findProperty("POM_ARTIFACT_ID"), project.release.versionName)
145-
}
146-
}
147-
}
14881
asNode().children().last() + pomConfig
14982
}
15083
}
15184
}
85+
86+
repositories {
87+
maven {
88+
name = "sonatype"
89+
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
90+
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
91+
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
92+
93+
credentials {
94+
username getRepositoryUsername()
95+
password getRepositoryPassword()
96+
}
97+
}
98+
}
15299
}
100+
}
101+
102+
signing {
103+
sign publishing.publications
153104
}
Collapse file

‎library-core/build.gradle‎

Copy file name to clipboardExpand all lines: library-core/build.gradle
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33

4+
version release.versionName
5+
46
android {
57
compileSdkVersion setup.compileSdk
68
buildToolsVersion setup.buildTools
Collapse file

‎library-definitions/build.gradle‎

Copy file name to clipboardExpand all lines: library-definitions/build.gradle
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
apply plugin: 'com.android.library'
22

3+
version release.versionName
4+
35
android {
46
compileSdkVersion setup.compileSdk
57
buildToolsVersion setup.buildTools
Collapse file

‎library/build.gradle‎

Copy file name to clipboardExpand all lines: library/build.gradle
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: "androidx.navigation.safeargs.kotlin"
44

5+
version release.versionName
6+
57
android {
68
compileSdkVersion setup.compileSdk
79
buildToolsVersion setup.buildTools
Collapse file

‎release.sh‎

Copy file name to clipboardExpand all lines: release.sh
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
if [ "$1" = "release" ];
66
then
7-
./gradlew library-core:bintrayUpload -Plibrary_core_only
8-
./gradlew library:bintrayUpload -x test -x lint -Plibrary_only
9-
./gradlew library-definitions:bintrayUpload -x test -x lint -Plibrary_definitions_only
7+
./gradlew library-core:publishReleasePublicationToSonatypeRepository -Plibrary_core_only
8+
./gradlew library:publishReleasePublicationToSonatypeRepository -x test -x lint -Plibrary_only
9+
./gradlew library-definitions:publishReleasePublicationToSonatypeRepository -x test -x lint -Plibrary_definitions_only
1010
else
1111
//TODO
1212
fi

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.