Skip to content

Commit

Permalink
Update to new publish plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
prof18 committed Nov 5, 2022
1 parent 9e0caf6 commit 8421fc8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 50 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/publish-library.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,29 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

# Base64 decodes and pipes the GPG key content into the secret file
- name: Prepare environment
env:
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
run: |
git fetch --unshallow
sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > '$SIGNING_SECRET_KEY_RING_FILE'"
# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :rssparser:test :rssparser:assembleRelease
run: ./gradlew :rssparser:assembleRelease

# Generates other artifacts (javadocJar is optional)
- name: Source jar and dokka
run: ./gradlew androidSourcesJar javadocJar

# Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
run: ./gradlew publish --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
10 changes: 0 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
//apply plugin: "com.github.ben-manes.versions"

buildscript {
ext.versions = [
'libVersionCode' : 31005,
'libVersionName' : '3.1.5',
// todo :delete
]

repositories {
google()
mavenCentral()
Expand All @@ -22,13 +16,11 @@ buildscript {
classpath(libs.com.android.tools.build.gradle)
classpath(libs.org.jetbrains.kotlin.gradle.plugin)
classpath(libs.org.jetbrains.dokka.gradle.plugin)

classpath(libs.com.vanniktech.gradle.maven.publish.plugin)
}
}

plugins {
id 'com.autonomousapps.dependency-analysis' version "1.13.1" // todo delete
alias(libs.plugins.com.github.ben.manes.versions)
}

Expand All @@ -39,8 +31,6 @@ allprojects {
maven {
url = "https://dl.bintray.com/kotlin/dokka"
}
// // org.jetbrains.trove4j:trove4j:20160824.
// maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
}

Expand Down
38 changes: 23 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,26 @@
android.enableJetifier=false
android.useAndroidX=true

#GROUP=
#VERSION_NAME=
#
#POM_INCEPTION_YEAR=2020
#POM_URL=
#POM_SCM_URL=
#POM_SCM_CONNECTION=
#POM_SCM_DEV_CONNECTION=
#
#POM_LICENCE_NAME=The Apache Software License, Version 2.0
#POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
#POM_LICENCE_DIST=repo
#
#POM_DEVELOPER_ID=
#POM_DEVELOPER_NAME=
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

POM_ARTIFACT_ID=rssparser
POM_NAME=rssparser
POM_DESCRIPTION=An Android library to parse RSS Feed

GROUP=com.prof18.rssparser
VERSION_NAME=4.0.3

POM_INCEPTION_YEAR=2016
POM_URL=https://github.com/prof18/RSS-Parser.git
POM_SCM_URL=https://github.com/prof18/RSS-Parser/tree/master
POM_SCM_CONNECTION=scm:git:github.com/prof18/RSS-Parser.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://github.com/prof18/RSS-Parser.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=prof18
POM_DEVELOPER_NAME=Marco Gomiero
POM_DEVELOPER_URL=https://github.com/prof18/
9 changes: 4 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[versions]
android-gradle-plugin = "7.2.2"
android-gradle-plugin = "7.3.1"
android-compile-sdk = "33"
android-min-sdk = "21"
android-target-sdk = "33"
kotlin = "1.7.10"
library-version-code = "40000"
library-version-name = "4.0.0"
library-version-code = "40003"
library-version-name = "4.0.3"
androidx-activity = "1.5.1"
androidx-appcompat = "1.5.0"
androidx-arch-core = "2.1.0"
Expand All @@ -28,7 +28,7 @@ com-vanniktech-gradle-maven-publish-plugin="0.19.0"
junit = "4.13.2"
org-jetbrains-dokka = "1.7.10"
org-jetbrains-kotlinx-coroutines = "1.6.4"
org-robolectric = "4.8.2"
org-robolectric = "4.9"
io-mockk = "1.12.0"


Expand Down Expand Up @@ -64,7 +64,6 @@ org-jetbrains-kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlin
org-jetbrains-kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "org-jetbrains-kotlinx-coroutines" }
org-robolectric = { module = "org.robolectric:robolectric", version.ref = "org-robolectric" }
io-mockk = { module = "io.mockk:mockk", version.ref = "io-mockk" }
io-mockk-android = { module = "io.mockk:mockk-android", version.ref = "io-mockk" } # todo: delete


[plugins]
Expand Down
13 changes: 7 additions & 6 deletions rssparser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ plugins {
id 'com.google.devtools.ksp' version '1.7.10-1.0.6'
}

ext {
PUBLISH_GROUP_ID = 'com.prof18.rssparser'
PUBLISH_VERSION = versions.libVersionName
PUBLISH_ARTIFACT_ID = 'rssparser'
}
//ext {
// PUBLISH_GROUP_ID = 'com.prof18.rssparser'
// PUBLISH_VERSION = versions.libVersionName
// PUBLISH_ARTIFACT_ID = 'rssparser'
//}

//apply from: "${rootProject.projectDir}/gradle/publish-mavencentral.gradle"

android {
compileSdkVersion Integer.parseInt(libs.versions.android.compile.sdk.get())
Expand Down Expand Up @@ -49,7 +51,6 @@ dependencies {

testImplementation(libs.junit)
testImplementation(libs.org.robolectric)
testImplementation(libs.androidx.room.testing)
testImplementation(libs.androidx.arch.core.testing)
testImplementation(libs.androidx.test.core)
testImplementation(libs.org.jetbrains.kotlinx.coroutines.test)
Expand Down

0 comments on commit 8421fc8

Please sign in to comment.