Skip to content

Commit

Permalink
Merge pull request #122 from Petterpx/build_add_publish_maven
Browse files Browse the repository at this point in the history
build:支持上传maven
  • Loading branch information
Petterpx authored Oct 11, 2023
2 parents 7c13a40 + 0f13e1f commit 33d908a
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 25 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish_maven.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
7 changes: 2 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 0 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 3 additions & 13 deletions floatingx/build.gradle
Original file line number Diff line number Diff line change
@@ -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

Expand Down
25 changes: 24 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
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://[email protected]/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/

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 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

0 comments on commit 33d908a

Please sign in to comment.