diff --git a/.github/workflows/publish_maven.yml b/.github/workflows/publish_maven.yml new file mode 100644 index 0000000..d0b0698 --- /dev/null +++ b/.github/workflows/publish_maven.yml @@ -0,0 +1,25 @@ +name: Publish Maven + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + cache: gradle + - uses: burrunan/gradle-cache-action@v1 + name: Cache gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: publish maven + run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache closeAndReleaseRepository diff --git a/app/build.gradle b/app/build.gradle index e91fa78..22b7ebb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -73,5 +73,5 @@ dependencies { implementation "androidx.lifecycle:lifecycle-common-java8:2.3.1" debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10' // debugImplementation 'com.squareup.leakcanary:leakcanary-object-watcher-android-startup:2.10' - implementation isDev ? project(path: ':floatingx') : "com.github.Petterpx:FloatingX:$version_name" + implementation isDev ? project(path: ':floatingx') : "io.github.petterpx:floatingx:$version_name" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 34b63b5..5cea2fc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,12 @@ buildscript { apply from: "config.gradle" dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath 'com.android.tools.build:gradle:7.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { id 'io.gitlab.arturbosch.detekt' version '1.22.0' apply false -} - -task clean(type: Delete) { - delete rootProject.buildDir + id "com.vanniktech.maven.publish" version "0.25.3" } diff --git a/config.gradle b/config.gradle index 43b5f5a..91db2fd 100644 --- a/config.gradle +++ b/config.gradle @@ -6,8 +6,6 @@ ext { compilesdk_version = 31 version_name = gitVersionTag() versionCode = gitVersionCode() - group_id = 'com.petterp' - artifactId = 'floatingx' } println "isDev:$isDev,versionName:$version_name,versionCode:$versionCode" diff --git a/floatingx/build.gradle b/floatingx/build.gradle index 6fc8172..d78548e 100644 --- a/floatingx/build.gradle +++ b/floatingx/build.gradle @@ -1,23 +1,13 @@ plugins { id 'com.android.library' id 'kotlin-android' - id 'maven-publish' + id 'com.vanniktech.maven.publish' } -afterEvaluate { - publishing { - publications { - release(MavenPublication) { - from components.release - groupId = group_id - artifactId = artifactId - version = version_name - } - } - } +mavenPublishing { + coordinates("io.github.petterpx", "floatingx", version_name) } - android { compileSdk compilesdk_version diff --git a/gradle.properties b/gradle.properties index 2521752..f999cd4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,27 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 # 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 \ No newline at end of file +kotlin.code.style=official + +### mavencenterl +SONATYPE_HOST=S01 +RELEASE_SIGNING_ENABLED=true +GROUP=io.github.petterpx + +POM_NAME=Floatingx +POM_URL=https://github.com/Petterpx/FloatingX/ +POM_INCEPTION_YEAR=2021 +POM_DESCRIPTION=Android without permission suspension window(App), support global(View), local suspension, support edge adsorption, rebound, custom animation, position saving, windowing and split-screen position repair. + +POM_SCM_URL=https://github.com/Petterpx/FloatingX/ +POM_SCM_CONNECTION=scm:git:git:github.com/Petterpx/FloatingX.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Petterpx/FloatingX.git + +POM_LICENSE_NAME=The Apache Software License, Version 2.0 +POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENSE_DIST=repo + +POM_DEVELOPER_ID=petterpx +POM_DEVELOPER_NAME=Petterpx +POM_DEVELOPER_URL=https://github.com/Petterpx/ + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4a23f6d..0f6548a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed May 19 19:23:10 CST 2021 +#Tue Oct 10 00:04:01 CST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists