-
Notifications
You must be signed in to change notification settings - Fork 15
feat: Automatic publishing to maven central #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kxmpxtxnt
wants to merge
31
commits into
main
Choose a base branch
from
publish
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
e282cc2
update to new (hopefully correct) action
kxmpxtxnt 4409b4c
Merge pull request #79 from SilkMC/fix-publishing
kxmpxtxnt 082c736
fix paper requiring current version of other modules
kxmpxtxnt fcf889a
Revert "fix paper requiring current version of other modules"
kxmpxtxnt 31c41fc
remove silk-paper from settings.gradle.kts
kxmpxtxnt d26db91
fix missing toolchain java version, fix incorrect test
kxmpxtxnt 3106c03
add --stacktrace for more information
kxmpxtxnt 5067615
add more memory to actual task
kxmpxtxnt 3711f3d
give more memory to any jvm based task
kxmpxtxnt 3e7296b
Revert "give more memory to any jvm based task"
kxmpxtxnt c8ec8c3
Revert "add more memory to actual task"
kxmpxtxnt 73ec22a
Revert "add --stacktrace for more information"
kxmpxtxnt 21f12e0
Revert "fix missing toolchain java version, fix incorrect test"
kxmpxtxnt 3c54c4a
Revert "remove silk-paper from settings.gradle.kts"
kxmpxtxnt df73d79
Reapply "fix paper requiring current version of other modules"
kxmpxtxnt f3a64db
Revert "fix paper requiring current version of other modules"
kxmpxtxnt c1ab6f3
Merge remote-tracking branch 'origin/main' into publish
kxmpxtxnt 26e42d4
increase gradle memory
kxmpxtxnt 22460ed
update gradle action
kxmpxtxnt df9fde3
use compilerOptions dsl, add higher memory limit
kxmpxtxnt 9179e7a
removed MaxPermSize option
kxmpxtxnt d136832
removed FileEncoding option
kxmpxtxnt b82691f
remove memory limit from gradle properties, add it to build action
kxmpxtxnt 5e336ec
add signing in ci
kxmpxtxnt 63d761d
add no-daemon + stacktrace option to gradle
kxmpxtxnt 1a8279c
removed hard coded memory minimum
kxmpxtxnt 8e13475
Merge remote-tracking branch 'origin/main' into publish
kxmpxtxnt 45f3458
use vanniktecks publishing plugin
kxmpxtxnt 18e69b7
Merge branch 'main' into publish
kxmpxtxnt fed1469
Merge remote-tracking branch 'origin/main' into publish
kxmpxtxnt e96bbad
merge
kxmpxtxnt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 28 additions & 51 deletions
79
buildSrc/src/main/kotlin/project-publish-script.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,44 @@ | ||
| import BuildConstants.authors | ||
| import BuildConstants.githubRepo | ||
| import BuildConstants.isSnapshot | ||
| import com.vanniktech.maven.publish.KotlinJvm | ||
|
|
||
| plugins { | ||
| kotlin("jvm") | ||
|
|
||
| `maven-publish` | ||
| signing | ||
| id("com.vanniktech.maven.publish") | ||
| } | ||
|
|
||
| publishing { | ||
| repositories { | ||
| maven { | ||
| name = "ossrh" | ||
| credentials(PasswordCredentials::class) | ||
| setUrl( | ||
| if (!isSnapshot) | ||
| "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" | ||
| else | ||
| "https://s01.oss.sonatype.org/content/repositories/snapshots" | ||
| ) | ||
| } | ||
| } | ||
| mavenPublishing { | ||
| configure(KotlinJvm()) | ||
|
|
||
| publications { | ||
| register<MavenPublication>(project.name) { | ||
| // publish main jars | ||
| from(components["java"]) | ||
| publishToMavenCentral(false) | ||
|
|
||
| this.groupId = project.group.toString() | ||
| this.artifactId = project.name | ||
| this.version = rootProject.version.toString() | ||
| signAllPublications() | ||
|
|
||
| pom { | ||
| name.set(project.name) | ||
| description.set(project.description) | ||
| pom { | ||
| name = project.name | ||
| description = project.description | ||
|
|
||
| developers { | ||
| authors.forEach { | ||
| developer { | ||
| name.set(it) | ||
| } | ||
| } | ||
| developers { | ||
| authors.forEach { | ||
| developer { | ||
| name = it | ||
| } | ||
| } | ||
| } | ||
|
|
||
| licenses { | ||
| license { | ||
| name.set("GNU General Public License 3") | ||
| url.set("https://www.gnu.org/licenses/gpl-3.0.txt") | ||
| } | ||
| } | ||
| licenses { | ||
| license { | ||
| name = "GNU General Public License 3" | ||
| url = "https://www.gnu.org/licenses/gpl-3.0.txt" | ||
| distribution = "https://www.gnu.org/licenses/gpl-3.0.txt" | ||
| } | ||
| } | ||
|
|
||
| url.set("https://github.com/${githubRepo}") | ||
| url = "https://github.com/$githubRepo" | ||
|
|
||
| scm { | ||
| connection.set("scm:git:git://github.com/${githubRepo}.git") | ||
| url.set("https://github.com/${githubRepo}/tree/main") | ||
| } | ||
| } | ||
| scm { | ||
| connection = "scm:git:git://github.com/$githubRepo.git" | ||
| url = "https://github.com/$githubRepo/tree/main" | ||
| developerConnection = "cm:git:ssh://git@github.com/$githubRepo.git" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| signing { | ||
| sign(publishing.publications) | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to directly publish the components, instead of pressing publish everytime in the sonatype deployment area we can achieve this by setting this to true