diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a94cc4a2..e72a2fd6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/build.gradle.kts b/build.gradle.kts index 374c5402..71d46e49 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,16 +22,47 @@ configure(subprojects) { publications { create("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() } } } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..d80b9da1 --- /dev/null +++ b/gradle.properties @@ -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=git@github.com:FAForever/faf-java-commons.git +version=unspecified