Skip to content

Commit

Permalink
Publish to maven central (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 authored Mar 3, 2024
1 parent 8caaaaa commit a57c4fb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ jobs:
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_CENTRAL_URL: ${{ secrets.MAVEN_CENTRAL_URL }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
SIGNING_SERVER: ${{ secrets.SIGNING_SERVER }}
SIGNING_PGP_KEY: ${{ secrets.SIGNING_PGP_KEY }}
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ buildscript {
}
}

plugins {
id "me.modmuss50.remotesign" version "0.4.0"
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

// Apply plugin
Expand Down Expand Up @@ -505,9 +509,27 @@ publishing {
}
}
}

if (ENV.MAVEN_CENTRAL_URL) {
repositories.maven {
name "central"
url ENV.MAVEN_CENTRAL_URL
credentials {
username ENV.MAVEN_CENTRAL_USERNAME
password ENV.MAVEN_CENTRAL_PASSWORD
}
}
}
}
}

remoteSign {
requestUrl = ENV.SIGNING_SERVER
pgpAuthKey = ENV.SIGNING_PGP_KEY
useDummyForTesting = ENV.SIGNING_SERVER == null
sign publishing.publications.developer
}

// A task to ensure that the version being released has not already been released.
task checkVersion {
doFirst {
Expand Down
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
}
}

rootProject.name = name

0 comments on commit a57c4fb

Please sign in to comment.