mirror of
https://github.com/LSPosed/LSPlant.git
synced 2025-05-04 20:42:02 +08:00
Add maven publish
This commit is contained in:
parent
856f6e0402
commit
b60879e048
84
.github/workflows/build.yml
vendored
Normal file
84
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on: [ push, pull_request ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build on ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest, windows-latest, macOS-latest ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: '11'
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew :lsplant:publishToMavenLocal
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }}
|
||||||
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }}
|
||||||
|
- name: Upload library
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }}-library
|
||||||
|
path: ~/.m2
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
|
name: Test on API ${{ matrix.api-level }}
|
||||||
|
runs-on: macos-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
api-level: [ 28, 29, 30, 31, 32 ]
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: '11'
|
||||||
|
- name: AVD cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: avd-cache
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.android/avd/*
|
||||||
|
~/.android/adb*
|
||||||
|
key: avd-${{ matrix.api-level }}
|
||||||
|
- name: create AVD and generate snapshot for caching
|
||||||
|
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||||
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
|
with:
|
||||||
|
api-level: ${{ matrix.api-level }}
|
||||||
|
arch: x86_64
|
||||||
|
target: google_apis
|
||||||
|
script: echo "Generated AVD snapshot for caching."
|
||||||
|
force-avd-creation: false
|
||||||
|
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
|
disable-animations: false
|
||||||
|
- name: run tests
|
||||||
|
uses: reactivecircus/android-emulator-runner@v2
|
||||||
|
with:
|
||||||
|
api-level: ${{ matrix.api-level }}
|
||||||
|
arch: x86_64
|
||||||
|
target: google_apis
|
||||||
|
script: ./gradlew :test:connectedCheck; ./gradlew :test:connectedCheck
|
||||||
|
force-avd-creation: false
|
||||||
|
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||||
|
disable-animations: true
|
||||||
|
- name: Upload outputs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: test-outputs
|
||||||
|
path: test/build/outputs
|
29
.github/workflows/maven.yml
vendored
Normal file
29
.github/workflows/maven.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: Maven
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: '11'
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: |
|
||||||
|
sed -i '/withSourcesJar()/d' library/build.gradle
|
||||||
|
./gradlew :lsplant:publishToMavenLocal
|
||||||
|
git reset --hard HEAD
|
||||||
|
./gradlew :lsplant:publish
|
||||||
|
env:
|
||||||
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }}
|
||||||
|
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }}
|
||||||
|
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.ossrhUsername }}
|
||||||
|
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.ossrhPassword }}
|
@ -3,7 +3,7 @@ val androidMinSdkVersion by extra(27)
|
|||||||
val androidBuildToolsVersion by extra("32.0.0")
|
val androidBuildToolsVersion by extra("32.0.0")
|
||||||
val androidCompileSdkVersion by extra(32)
|
val androidCompileSdkVersion by extra(32)
|
||||||
val androidNdkVersion by extra("23.1.7779620")
|
val androidNdkVersion by extra("23.1.7779620")
|
||||||
val androidCmakeVersion by extra("3.22.1")
|
val androidCmakeVersion by extra("3.18.1")
|
||||||
|
|
||||||
tasks.register("Delete", Delete::class) {
|
tasks.register("Delete", Delete::class) {
|
||||||
delete(rootProject.buildDir)
|
delete(rootProject.buildDir)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.library")
|
id("com.android.library")
|
||||||
|
id("maven-publish")
|
||||||
|
id("signing")
|
||||||
}
|
}
|
||||||
|
|
||||||
val androidTargetSdkVersion: Int by rootProject.extra
|
val androidTargetSdkVersion: Int by rootProject.extra
|
||||||
@ -15,6 +17,7 @@ android {
|
|||||||
buildToolsVersion = androidBuildToolsVersion
|
buildToolsVersion = androidBuildToolsVersion
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
|
buildConfig = false
|
||||||
prefabPublishing = true
|
prefabPublishing = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,4 +92,61 @@ android {
|
|||||||
version = androidCmakeVersion
|
version = androidCmakeVersion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
singleVariant("release") {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
register<MavenPublication>("lsplant") {
|
||||||
|
group = "org.lsposed.lsplant"
|
||||||
|
artifactId = "lsplant"
|
||||||
|
version = "1.0"
|
||||||
|
afterEvaluate {
|
||||||
|
from(components.getByName("release"))
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name.set("LSPlant")
|
||||||
|
description.set("A hook framework for Android Runtime (ART)")
|
||||||
|
url.set("https://github.com/LSPosed/LSPlant")
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("GNU Lesser General Public License v3.0")
|
||||||
|
url.set("https://github.com/LSPosed/LSPlant/blob/master/LICENSE")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
name.set("Lsposed")
|
||||||
|
url.set("https://lsposed.org")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection.set("scm:git:https://github.com/LSPosed/LSPlant.git")
|
||||||
|
url.set("https://github.com/LSPosed/LSPlant")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "ossrh"
|
||||||
|
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
|
||||||
|
credentials(PasswordCredentials::class)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
val signingKey = findProperty("signingKey") as String?
|
||||||
|
val signingPassword = findProperty("signingPassword") as String?
|
||||||
|
if (signingKey != null && signingPassword != null) {
|
||||||
|
useInMemoryPgpKeys(signingKey, signingPassword)
|
||||||
|
}
|
||||||
|
sign(publishing.publications)
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ android {
|
|||||||
buildToolsVersion = androidBuildToolsVersion
|
buildToolsVersion = androidBuildToolsVersion
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
|
buildConfig = false
|
||||||
prefab = true
|
prefab = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user