Skip to content

Commit

Permalink
Publishing to new maven central (#197)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
leandroBorgesFerreira and CI Bot authored Feb 13, 2025
1 parent 7b96da0 commit ee43d91
Show file tree
Hide file tree
Showing 34 changed files with 285 additions and 693 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Check out code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
distribution: adopt
java-version: '21'
- name: Build with Gradle
run: ./gradlew assemble
run: ./gradlew assembleRelease
26 changes: 12 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
name: Publish

on:
release:
types: [released]
workflow_dispatch:

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3.1.0
- name: Set up JDK 17
uses: actions/setup-java@v3.5.1
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
java-version: '21'
- name: Release build
run: ./gradlew assembleRelease --scan
run: ./gradlew :loading-button-android:assembleRelease
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 --scan
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_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 }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.NEW_SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.NEW_SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.NEW_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.NEW_SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.NEW_SIGNING_KEY }}
32 changes: 0 additions & 32 deletions build.gradle

This file was deleted.

10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.application) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.sonatype.publish) apply false
alias(libs.plugins.kotlin.compose) apply false
}

extra["libraryVersion"] = "0.7.0"
31 changes: 16 additions & 15 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx1024M -Dkotlin.daemon.jvm.options\="-Xmx1024M" -XX\:+UseParallelGC -XX\:MaxMetaspaceSize\=512m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
android.enableJetifier=true
android.useAndroidX=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
kotlin.code.style=official
kotlin.incremental=true
org.gradle.caching=true

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
org.jetbrains.compose.experimental.uikit.enabled=true
org.jetbrains.compose.experimental.jscanvas.enabled=true

11 changes: 0 additions & 11 deletions gradle/buildWithTravis.sh

This file was deleted.

48 changes: 48 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[versions]
activityCompose = "1.10.0"
agp = "8.8.0"
appcompat = "1.7.0"
composeBom = "2025.02.00"
constraintlayout = "2.2.0"
core = "1.6.1"
coreKtx = "1.15.0"
espressoCore = "3.6.1"
junit = "4.13.2"
junitVersion = "1.2.1"
kotlin = "2.1.10"
lifecycleRuntimeKtx = "2.8.7"
material = "1.12.0"
mockitoCore = "5.15.2"
mockitoKotlin = "2.2.0"
publish = "0.30.0"
robolectric = "4.14.1"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-core = { module = "androidx.test:core", version.ref = "core" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-material3 = { module = "androidx.compose.material3:material3" }
androidx-ui = { module = "androidx.compose.ui:ui" }
androidx-ui-graphics = { module = "androidx.compose.ui:ui-graphics" }
androidx-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" }
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
junit = { module = "junit:junit", version.ref = "junit" }
material = { module = "com.google.android.material:material", version.ref = "material" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockitoCore" }
mockito-kotlin = { module = "com.nhaarman.mockitokotlin2:mockito-kotlin", version.ref = "mockitoKotlin" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }

[plugins]
application = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
sonatype-publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Mar 06 10:41:53 EST 2024
#Fri Apr 14 15:25:27 CEST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
71 changes: 58 additions & 13 deletions loading-button-android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,58 @@
import com.vanniktech.maven.publish.SonatypeHost

val libraryVersion: String by rootProject.extra

plugins {
id("com.android.library")
kotlin("android")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.sonatype.publish)
}


mavenPublishing {
val artifactId = "loading-button"

coordinates(
groupId = "io.writeopia",
artifactId = artifactId,
version = libraryVersion
)

pom {
name = artifactId
description = "Core module of Writeopia"
url = "https://github.com/leandroBorgesFerreira/LoadingButtonAndroid"

developers {
developer {
id = "leandroBorgesFerreira"
name = "Leandro Borges Ferreira"
url = "https://github.com/leandroBorgesFerreira"
}
}

licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}

scm {
connection = "scm:[email protected]:leandroBorgesFerreira/LoadingButtonAndroid.git"
developerConnection = "scm:git:ssh://github.com/leandroBorgesFerreira/LoadingButtonAndroid.git"
url = "https://github.com/leandroBorgesFerreira/LoadingButtonAndroid"
}
}

signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = false)
}

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

android {
namespace = "com.github.leandroborgesferreira.loadingbutton"
compileSdk = 34
namespace = "io.writeopia.loadingbutton"
compileSdk = 35

defaultConfig {
minSdk = 21
Expand Down Expand Up @@ -35,12 +80,12 @@ android {
}

dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")

testImplementation("org.mockito:mockito-core:5.3.1")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
testImplementation("org.robolectric:robolectric:4.10")
testImplementation("androidx.test:core:1.5.0")
testImplementation("junit:junit:4.13.2")
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)

testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.robolectric)
testImplementation(libs.androidx.core)
testImplementation(libs.junit)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.leandroborgesferreira.loadingbutton
package io.writeopia.loadingbutton

import android.animation.Animator
import android.view.View
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.leandroborgesferreira.loadingbutton.animatedDrawables
package io.writeopia.loadingbutton.animatedDrawables

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
Expand All @@ -14,8 +14,8 @@ import android.graphics.drawable.Animatable
import android.graphics.drawable.Drawable
import android.view.animation.AccelerateDecelerateInterpolator
import android.view.animation.LinearInterpolator
import com.github.leandroborgesferreira.loadingbutton.customViews.ProgressButton
import com.github.leandroborgesferreira.loadingbutton.disposeAnimator
import io.writeopia.loadingbutton.customViews.ProgressButton
import io.writeopia.loadingbutton.disposeAnimator

const val MIN_PROGRESS = 0F
const val MAX_PROGRESS = 100F
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.leandroborgesferreira.loadingbutton.animatedDrawables
package io.writeopia.loadingbutton.animatedDrawables

import android.animation.Animator
import android.animation.AnimatorListenerAdapter
Expand All @@ -14,8 +14,8 @@ import android.graphics.PixelFormat
import android.graphics.drawable.Animatable
import android.graphics.drawable.Drawable
import android.view.animation.DecelerateInterpolator
import com.github.leandroborgesferreira.loadingbutton.customViews.ProgressButton
import com.github.leandroborgesferreira.loadingbutton.disposeAnimator
import io.writeopia.loadingbutton.customViews.ProgressButton
import io.writeopia.loadingbutton.disposeAnimator

private const val REVEAL_DURATION = 120L
private const val ALPHA_ANIMATION_DURATION = 80L
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.writeopia.loadingbutton.animatedDrawables

enum class ProgressType {
DETERMINATE, INDETERMINATE
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.leandroborgesferreira.loadingbutton.customViews
package io.writeopia.loadingbutton.customViews

import android.animation.AnimatorSet
import android.content.Context
Expand All @@ -11,12 +11,12 @@ import androidx.appcompat.widget.AppCompatButton
import androidx.core.content.ContextCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.OnLifecycleEvent
import com.github.leandroborgesferreira.loadingbutton.animatedDrawables.CircularProgressAnimatedDrawable
import com.github.leandroborgesferreira.loadingbutton.animatedDrawables.CircularRevealAnimatedDrawable
import com.github.leandroborgesferreira.loadingbutton.animatedDrawables.ProgressType
import com.github.leandroborgesferreira.loadingbutton.disposeAnimator
import com.github.leandroborgesferreira.loadingbutton.presentation.ProgressButtonPresenter
import com.github.leandroborgesferreira.loadingbutton.presentation.State
import io.writeopia.loadingbutton.animatedDrawables.CircularProgressAnimatedDrawable
import io.writeopia.loadingbutton.animatedDrawables.CircularRevealAnimatedDrawable
import io.writeopia.loadingbutton.animatedDrawables.ProgressType
import io.writeopia.loadingbutton.disposeAnimator
import io.writeopia.loadingbutton.presentation.ProgressButtonPresenter
import io.writeopia.loadingbutton.presentation.State

open class CircularProgressButton : AppCompatButton, ProgressButton {

Expand Down
Loading

0 comments on commit ee43d91

Please sign in to comment.