Skip to content

Commit ee43d91

Browse files
leandroBorgesFerreiraCI Bot
andauthored
Publishing to new maven central (#197)
* Removing old code1 * Bumping name and change package name * configuring publish script * Changing secrets * Changing assemble to assembleRelease --------- Co-authored-by: CI Bot <[email protected]>
1 parent 7b96da0 commit ee43d91

34 files changed

+285
-693
lines changed

.github/workflows/assemble.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up JDK 17
19-
uses: actions/setup-java@v3
17+
- name: Check out code
18+
uses: actions/checkout@v4
19+
- name: Set up JDK 21
20+
uses: actions/setup-java@v4
2021
with:
21-
distribution: 'adopt'
22-
java-version: '17'
23-
- name: Grant execute permission for gradlew
24-
run: chmod +x gradlew
22+
distribution: adopt
23+
java-version: '21'
2524
- name: Build with Gradle
26-
run: ./gradlew assemble
25+
run: ./gradlew assembleRelease

.github/workflows/publish.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
name: Publish
22

33
on:
4-
release:
5-
types: [released]
4+
workflow_dispatch:
65

76
jobs:
87
publish:
98
name: Release build and publish
109
runs-on: ubuntu-latest
1110
steps:
1211
- name: Check out code
13-
uses: actions/checkout@v3.1.0
14-
- name: Set up JDK 17
15-
uses: actions/setup-java@v3.5.1
12+
uses: actions/checkout@v4
13+
- name: Set up JDK 21
14+
uses: actions/setup-java@v4
1615
with:
1716
distribution: adopt
18-
java-version: 17
17+
java-version: '21'
1918
- name: Release build
20-
run: ./gradlew assembleRelease --scan
19+
run: ./gradlew :loading-button-android:assembleRelease
2120
- name: Publish to MavenCentral
22-
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --scan
21+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
2322
env:
24-
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
25-
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
26-
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
27-
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
28-
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
29-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
23+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEW_SONATYPE_NEXUS_USERNAME }}
24+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEW_SONATYPE_NEXUS_PASSWORD }}
25+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.NEW_SIGNING_KEY_ID }}
26+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.NEW_SIGNING_PASSWORD }}
27+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.NEW_SIGNING_KEY }}

build.gradle

Lines changed: 0 additions & 32 deletions
This file was deleted.

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
plugins {
3+
alias(libs.plugins.application) apply false
4+
alias(libs.plugins.androidLibrary) apply false
5+
alias(libs.plugins.kotlinAndroid) apply false
6+
alias(libs.plugins.sonatype.publish) apply false
7+
alias(libs.plugins.kotlin.compose) apply false
8+
}
9+
10+
extra["libraryVersion"] = "0.7.0"

gradle.properties

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# Project-wide Gradle settings.
2-
32
# IDE (e.g. Android Studio) users:
43
# Gradle settings configured through the IDE *will override*
54
# any settings specified in this file.
6-
75
# For more details on how to configure your build environment visit
86
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
107
# Specifies the JVM arguments used for the daemon process.
118
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
org.gradle.jvmargs=-Xmx1024M -Dkotlin.daemon.jvm.options\="-Xmx1024M" -XX\:+UseParallelGC -XX\:MaxMetaspaceSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
15-
android.enableJetifier=true
16-
android.useAndroidX=true
17-
android.defaults.buildfeatures.buildconfig=true
18-
android.nonTransitiveRClass=false
19-
android.nonFinalResIds=false
20-
kotlin.code.style=official
21-
kotlin.incremental=true
22-
org.gradle.caching=true
23-
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
2410
# When configured, Gradle will run in incubating parallel mode.
2511
# This option should only be used with decoupled projects. More details, visit
2612
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
2713
# org.gradle.parallel=true
14+
# AndroidX package structure to make it clearer which packages are bundled with the
15+
# Android operating system, and which are packaged with your app's APK
16+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
17+
android.useAndroidX=true
18+
# Kotlin code style for this project: "official" or "obsolete":
19+
kotlin.code.style=official
20+
# Enables namespacing of each library's R class so that its R class includes only the
21+
# resources declared in the library itself and none from the library's dependencies,
22+
# thereby reducing the size of the R class for that library
23+
android.nonTransitiveRClass=true
24+
android.defaults.buildfeatures.buildconfig=true
25+
android.nonFinalResIds=false
26+
org.jetbrains.compose.experimental.uikit.enabled=true
27+
org.jetbrains.compose.experimental.jscanvas.enabled=true
28+

gradle/buildWithTravis.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

gradle/libs.versions.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[versions]
2+
activityCompose = "1.10.0"
3+
agp = "8.8.0"
4+
appcompat = "1.7.0"
5+
composeBom = "2025.02.00"
6+
constraintlayout = "2.2.0"
7+
core = "1.6.1"
8+
coreKtx = "1.15.0"
9+
espressoCore = "3.6.1"
10+
junit = "4.13.2"
11+
junitVersion = "1.2.1"
12+
kotlin = "2.1.10"
13+
lifecycleRuntimeKtx = "2.8.7"
14+
material = "1.12.0"
15+
mockitoCore = "5.15.2"
16+
mockitoKotlin = "2.2.0"
17+
publish = "0.30.0"
18+
robolectric = "4.14.1"
19+
20+
[libraries]
21+
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
22+
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
23+
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" }
24+
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
25+
androidx-core = { module = "androidx.test:core", version.ref = "core" }
26+
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
27+
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
28+
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
29+
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
30+
androidx-material3 = { module = "androidx.compose.material3:material3" }
31+
androidx-ui = { module = "androidx.compose.ui:ui" }
32+
androidx-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
33+
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
34+
androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
35+
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
36+
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
37+
junit = { module = "junit:junit", version.ref = "junit" }
38+
material = { module = "com.google.android.material:material", version.ref = "material" }
39+
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
40+
mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockitoKotlin" }
41+
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
42+
43+
[plugins]
44+
application = { id = "com.android.application", version.ref = "agp" }
45+
androidLibrary = { id = "com.android.library", version.ref = "agp" }
46+
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
47+
sonatype-publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
48+
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Mar 06 10:41:53 EST 2024
1+
#Fri Apr 14 15:25:27 CEST 2023
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
34
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
5-
zipStoreBase=GRADLE_USER_HOME
65
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

loading-button-android/build.gradle.kts

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,58 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
3+
val libraryVersion: String by rootProject.extra
4+
15
plugins {
2-
id("com.android.library")
3-
kotlin("android")
6+
alias(libs.plugins.androidLibrary)
7+
alias(libs.plugins.kotlinAndroid)
8+
alias(libs.plugins.sonatype.publish)
9+
}
10+
11+
12+
mavenPublishing {
13+
val artifactId = "loading-button"
14+
15+
coordinates(
16+
groupId = "io.writeopia",
17+
artifactId = artifactId,
18+
version = libraryVersion
19+
)
20+
21+
pom {
22+
name = artifactId
23+
description = "Core module of Writeopia"
24+
url = "https://github.com/leandroBorgesFerreira/LoadingButtonAndroid"
25+
26+
developers {
27+
developer {
28+
id = "leandroBorgesFerreira"
29+
name = "Leandro Borges Ferreira"
30+
url = "https://github.com/leandroBorgesFerreira"
31+
}
32+
}
33+
34+
licenses {
35+
license {
36+
name = "The Apache Software License, Version 2.0"
37+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
38+
}
39+
}
40+
41+
scm {
42+
connection = "scm:[email protected]:leandroBorgesFerreira/LoadingButtonAndroid.git"
43+
developerConnection = "scm:git:ssh://github.com/leandroBorgesFerreira/LoadingButtonAndroid.git"
44+
url = "https://github.com/leandroBorgesFerreira/LoadingButtonAndroid"
45+
}
46+
}
47+
48+
signAllPublications()
49+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = false)
450
}
551

6-
apply(from = "${rootDir}/scripts/publish-module.gradle")
752

853
android {
9-
namespace = "com.github.leandroborgesferreira.loadingbutton"
10-
compileSdk = 34
54+
namespace = "io.writeopia.loadingbutton"
55+
compileSdk = 35
1156

1257
defaultConfig {
1358
minSdk = 21
@@ -35,12 +80,12 @@ android {
3580
}
3681

3782
dependencies {
38-
implementation("androidx.core:core-ktx:1.12.0")
39-
implementation("androidx.appcompat:appcompat:1.6.1")
40-
41-
testImplementation("org.mockito:mockito-core:5.3.1")
42-
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
43-
testImplementation("org.robolectric:robolectric:4.10")
44-
testImplementation("androidx.test:core:1.5.0")
45-
testImplementation("junit:junit:4.13.2")
83+
implementation(libs.androidx.core.ktx)
84+
implementation(libs.androidx.appcompat)
85+
86+
testImplementation(libs.mockito.core)
87+
testImplementation(libs.mockito.kotlin)
88+
testImplementation(libs.robolectric)
89+
testImplementation(libs.androidx.core)
90+
testImplementation(libs.junit)
4691
}

loading-button-android/src/main/java/com/github/leandroborgesferreira/loadingbutton/animatedDrawables/ProgressType.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)