Skip to content

Commit

Permalink
feat: publish patches to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpanseCodes authored Sep 23, 2023
1 parent 72e2ed5 commit 0e05372
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,18 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew generateMeta clean

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Setup semantic-release
run: npm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: npm exec semantic-release
60 changes: 60 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
plugins {
kotlin("jvm") version "1.8.20"
alias(libs.plugins.ksp)
`maven-publish`
signing
}

group = "app.revanced"
Expand All @@ -25,6 +27,64 @@ repositories {
}
}


signing {
useGpgCmd()
sign(publishing.publications)
}

val isDev = project.version.toString().contains("-dev")

publishing {
repositories {
mavenLocal()
maven {
url = if (isDev)
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
else
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")

credentials {
username = (System.getenv("OSSRH_USERNAME") ?: "").toString()
password = (System.getenv("OSSRH_PASSWORD") ?: "").toString()
}
}
}
publications {
create<MavenPublication>("gpr") {
from(components["java"])

version = project.version.toString()
if (isDev) version += "-SNAPSHOT"

pom {
name = "ReVanced Patches"
description = "Patches used by ReVanced."
url = "https://revanced.app"

licenses {
license {
name = "GNU General Public License v3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
}
}
developers {
developer {
id = "ExpanseCodes"
name = "ExpanseCodes"
email = "[email protected]"
}
}
scm {
connection = "scm:git:git:/ExpanseCodes/revanced-patches.git"
developerConnection = "scm:git:[email protected]:ExpanseCodes/revanced-patches.git"
url = "https:/ExpanseCodes/revanced-patches"
}
}
}
}
}

dependencies {
implementation(libs.revanced.patcher)
implementation(libs.smali)
Expand Down

0 comments on commit 0e05372

Please sign in to comment.