Skip to content

Commit

Permalink
Publish to maven central
Browse files Browse the repository at this point in the history
  • Loading branch information
Brutus5000 committed Nov 23, 2024
1 parent a977045 commit cd2bc77
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Configure GPG Key
run: |
echo -n "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode > $HOME/secring.gpg
- name: Publish package
run: ./gradlew publish -Pversion=$VERSION
run: ./gradlew publish -Pversion=$VERSION -Psigning.secretKeyRingFile="$HOME/secring.gpg" -Psigning.password="${{ secrets.GPG_SIGNING_KEY_PASSWORD }}" -Psigning.keyId="${{ secrets.GPG_SIGNING_KEY_ID }}" -PsonatypeUsername="${{ secrets.SONATYPE_USERNAME }}" -PsonatypePassword="${{ secrets.SONATYPE_PASSWORD }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 35 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,47 @@ configure(subprojects) {
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.properties["project_display_name"].toString())
description.set(project.properties["project_description"].toString())
url.set(project.properties["project_website"].toString())
issueManagement {
system.set("GitHub")
url.set(project.properties["project_issues"].toString())
}
scm {
url.set(project.properties["project_website"].toString())
connection.set("scm:git:${project.properties["project_vcs"].toString()}")
developerConnection.set("scm:git:${project.properties["project_vcs_git"].toString()}")
}
licenses {
license {
name.set("The MIT License (MIT)")
url.set("http://www.opensource.org/licenses/mit-license.php")
distribution.set("repo")
}
}
developers {
developer {
id.set("Brutus5000")
name.set("Brutus5000")
organization {
name.set("FAForever")
url.set("https://github.com/FAForever")
}
}
}
}
}
}

repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/FAForever/faf-java-commons")
name = "MavenCentral"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
username = project.properties["sonatypeUsername"].toString()
password = project.properties["sonatypePassword"].toString()
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project_website=https://github.com/FAForever/faf-java-commons
project_issues=https://github.com/FAForever/faf-java-commons/issues
project_vcs=https://github.com/FAForever/faf-java-commons.git
project_vcs_git[email protected]:FAForever/faf-java-commons.git
version=unspecified

0 comments on commit cd2bc77

Please sign in to comment.