Skip to content

Commit 16d3985

Browse files
authored
migrate to maven central. (#121)
1 parent e0bfa9e commit 16d3985

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2222
-2565
lines changed

.github/release-drafter.yml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
name-template: '$RESOLVED_VERSION'
2-
tag-template: '$RESOLVED_VERSION'
1+
---
2+
name-template: "$RESOLVED_VERSION"
3+
tag-template: "$RESOLVED_VERSION"
34
prerelease: true
45
template: |
56
# What's Changed
67
78
$CHANGES
89
categories:
9-
- title: Breaking
10-
label: breaking
11-
- title: New
12-
label: enhancement
13-
- title: Bug Fixes
14-
label: bug
15-
- title: Maintenance
16-
label: maintenance
17-
- title: Documentation
18-
label: documentation
19-
- title: Dependency Updates
20-
label: dependencies
21-
10+
- title: "Breaking"
11+
label: "breaking"
12+
- title: "New"
13+
label: "enhancement"
14+
- title: "Bug Fixes"
15+
label: "bug"
16+
- title: "Maintenance"
17+
label: "maintenance"
18+
- title: "Documentation"
19+
label: "documentation"
20+
- title: "Dependency Updates"
21+
label: "dependencies"
2222
version-resolver:
2323
major:
2424
labels:
25-
- breaking
25+
- "breaking"
2626
minor:
2727
labels:
28-
- enhancement
28+
- "enhancement"
2929
patch:
3030
labels:
31-
- bug
32-
- maintenance
33-
- documentation
34-
- dependencies
35-
- security
36-
31+
- "bug"
32+
- "maintenance"
33+
- "documentation"
34+
- "dependencies"
35+
- "security"
3736
exclude-labels:
38-
- skip-changelog
37+
- "skip-changelog"

.github/workflows/build.yml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
name: Build
2-
3-
on:
1+
---
2+
name: "Build"
3+
"on":
44
pull_request:
5-
branches: [ master ]
6-
5+
branches:
6+
- "master"
77
jobs:
88
build:
9-
name: Build
10-
runs-on: ubuntu-latest
9+
name: "Build"
10+
runs-on: "ubuntu-latest"
1111
steps:
12-
- uses: actions/checkout@v4
13-
14-
- uses: actions/setup-java@v4
15-
with:
16-
distribution: 'adopt'
17-
java-version: '8'
18-
19-
- uses: arduino/setup-protoc@v1
20-
21-
- uses: actions/cache@v4
22-
with:
23-
path: ~/.gradle/caches
24-
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}
25-
restore-keys: |
26-
${{ runner.os }}-gradle-
27-
28-
- uses: actions/cache@v4
29-
with:
30-
path: ~/.gradle/wrapper
31-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}
32-
restore-keys: |
33-
${{ runner.os }}-gradlew-
34-
35-
- run: |
36-
chmod +x gradlew
37-
./gradlew build
12+
- uses: "actions/checkout@v4"
13+
- uses: "actions/setup-java@v4"
14+
with:
15+
distribution: "adopt"
16+
java-version: "11"
17+
- uses: "actions/cache@v4"
18+
with:
19+
path: "~/.gradle/caches"
20+
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}"
21+
restore-keys: |
22+
${{ runner.os }}-gradle-
23+
- uses: "actions/cache@v4"
24+
with:
25+
path: "~/.gradle/wrapper"
26+
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}"
27+
restore-keys: |
28+
${{ runner.os }}-gradlew-
29+
- run: |
30+
chmod +x gradlew
31+
./gradlew build

.github/workflows/changelog.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
name: Update Changelog
2-
3-
on:
1+
---
2+
name: "Update Changelog"
3+
"on":
44
push:
5-
branches: [ master ]
6-
5+
branches:
6+
- "master"
77
jobs:
88
changelog:
9-
name: Update Changelog
10-
runs-on: ubuntu-latest
11-
if: ${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}
9+
name: "Update Changelog"
10+
runs-on: "ubuntu-latest"
11+
if: "${{ !contains(github.event.head_commit.message, 'skip-snapshot') }}"
1212
steps:
13-
- uses: release-drafter/release-drafter@master
14-
id: release
15-
env:
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: "release-drafter/release-drafter@master"
14+
id: "release"
15+
env:
16+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: "Release"
3+
"on":
4+
release:
5+
types:
6+
- "released"
7+
jobs:
8+
build:
9+
name: "Release"
10+
runs-on: "ubuntu-latest"
11+
steps:
12+
- uses: "actions/checkout@v4"
13+
- uses: "actions/setup-java@v4"
14+
with:
15+
distribution: "adopt"
16+
java-version: "11"
17+
- uses: "actions/cache@v4"
18+
with:
19+
path: "~/.gradle/caches"
20+
key: "${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle.kts') }}"
21+
restore-keys: |
22+
${{ runner.os }}-gradle-
23+
- uses: "actions/cache@v4"
24+
with:
25+
path: "~/.gradle/wrapper"
26+
key: "${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle-wrapper.properties') }}"
27+
restore-keys: |
28+
${{ runner.os }}-gradlew-
29+
- run: |
30+
[[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
31+
chmod +x gradlew
32+
./gradlew -Psign-required=true publish -Pversion="${{ github.event.release.tag_name }}" -PmavenCentralUsername="${{ secrets.MAVEN_CENTRAL_USERNAME }}" -PmavenCentralPassword="${{ secrets.MAVEN_CENTRAL_PASSWORD }}" -PsigningInMemoryKey="${{ secrets.GPG_PRIVATE_KEY_ARMORED }}" -PsigningInMemoryKeyPassword="${{ secrets.GPG_PASSPHRASE }}"

.run/build.run.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
# agones4j
2-
[![](https://jitpack.io/v/infumia/agones4j.svg)](https://jitpack.io/#infumia/agones4j)
2+
[![Maven Central Version](https://img.shields.io/maven-central/v/net.infumia/agones4j)](https://central.sonatype.com/artifact/net.infumia/agones4j/)
33
## How to Use (Developers)
44
### Code
55
```groovy
66
repositories {
7-
maven("https://jitpack.io/")
7+
mavenCentral()
88
}
99
1010
dependencies {
11-
// https://mvnrepository.com/artifact/io.grpc/grpc-stub/latest
12-
implementation "io.grpc:grpc-stub:1.47.0"
13-
implementation "io.grpc:grpc-protobuf:1.47.0"
14-
implementation "io.grpc:grpc-netty:1.47.0"
15-
implementation "com.github.infumia:agones4j:VERSION"
11+
// Base module
12+
implementation "net.infumia:agones4j:VERSION"
13+
// Required, https://mvnrepository.com/artifact/io.grpc/grpc-stub/
14+
implementation "io.grpc:grpc-stub:1.64.0"
15+
implementation "io.grpc:grpc-protobuf:1.64.0"
16+
// Required, https://github.com/grpc/grpc-java/blob/master/gradle/libs.versions.toml#L46/
17+
implementation "org.apache.tomcat:annotations-api:1.64.0"
1618
}
1719
```
1820
```java

build.gradle.kts

Lines changed: 12 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,18 @@
1-
import com.google.protobuf.gradle.id
1+
import net.infumia.gradle.applyProtobuf
2+
import net.infumia.gradle.publish
3+
import net.infumia.gradle.spotless
24

3-
plugins {
4-
java
5-
`java-library`
6-
`maven-publish`
7-
alias(libs.plugins.protobuf)
8-
}
9-
10-
repositories {
11-
mavenCentral()
12-
}
13-
14-
dependencies {
15-
compileOnlyApi(libs.protobuf)
16-
compileOnlyApi(libs.grpc.protobuf)
17-
compileOnlyApi(libs.grpc.stub)
18-
compileOnlyApi(libs.annotationsapi)
19-
}
20-
21-
sourceSets {
22-
main {
23-
java {
24-
srcDirs("build/generated/source/proto/main/java")
25-
}
26-
resources {
27-
srcDir("src/main/proto")
28-
}
29-
}
30-
}
5+
plugins { java }
316

32-
protobuf {
33-
protoc { artifact = libs.protoc.get().toString() }
7+
publish()
348

35-
plugins {
36-
id("grpc") {
37-
artifact = "io.grpc:protoc-gen-grpc-java:${libs.versions.grpc.get()}"
38-
}
39-
}
9+
applyProtobuf()
4010

41-
generateProtoTasks {
42-
all().forEach {
43-
it.plugins {
44-
id("grpc") {
45-
outputSubDir = "java"
46-
}
47-
}
48-
}
49-
}
50-
}
51-
52-
tasks {
53-
compileJava {
54-
options.encoding = Charsets.UTF_8.name()
55-
}
56-
57-
javadoc {
58-
options.encoding = Charsets.UTF_8.name()
59-
(options as StandardJavadocDocletOptions).tags("todo")
60-
exclude("**/allocation/**")
61-
exclude("**/agones/**")
62-
exclude("**/com/google/api/**")
63-
exclude("**/grpc/**")
64-
}
65-
66-
val javadocJar by creating(Jar::class) {
67-
dependsOn("javadoc")
68-
archiveClassifier.set("javadoc")
69-
from(javadoc)
70-
}
11+
spotless()
7112

72-
val sourcesJar by creating(Jar::class) {
73-
dependsOn("classes")
74-
archiveClassifier.set("sources")
75-
duplicatesStrategy = DuplicatesStrategy.INCLUDE
76-
from(sourceSets["main"].allSource)
77-
}
78-
79-
processResources {
80-
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
81-
}
82-
}
83-
84-
publishing {
85-
publications {
86-
create<MavenPublication>("mavenJava") {
87-
groupId = project.group.toString()
88-
artifactId = "agones4j"
89-
version = project.version.toString()
90-
from(components["java"])
91-
artifact(tasks["sourcesJar"])
92-
artifact(tasks["javadocJar"])
93-
pom {
94-
name.set("Agones4J")
95-
description.set("Java wrapper for Agones client SDK.")
96-
url.set("https://infumia.com.tr/")
97-
licenses {
98-
license {
99-
name.set("MIT License")
100-
url.set("https://mit-license.org/license.txt")
101-
}
102-
}
103-
developers {
104-
developer {
105-
id.set("portlek")
106-
name.set("Hasan Demirtaş")
107-
email.set("utsukushihito@outlook.com")
108-
}
109-
}
110-
scm {
111-
connection.set("scm:git:git://github.com/infumia/agones4j.git")
112-
developerConnection.set("scm:git:ssh://github.com/infumia/agones4j.git")
113-
url.set("https://github.com/infumia/agones4j")
114-
}
115-
}
116-
}
117-
}
13+
dependencies {
14+
compileOnly(libs.protobuf)
15+
compileOnly(libs.grpc.protobuf)
16+
compileOnly(libs.grpc.stub)
17+
compileOnly(libs.annotationsapi)
11818
}

buildSrc/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
plugins { `kotlin-dsl` }
2+
3+
repositories {
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
8+
dependencies {
9+
// TODO: portlek, remove once
10+
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 is fixed
11+
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
12+
13+
implementation(libs.nexus.plugin)
14+
implementation(libs.spotless.plugin)
15+
implementation(libs.protobuf.plugin)
16+
}
17+
18+
kotlin { jvmToolchain(11) }

buildSrc/settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } }
3+
}

0 commit comments

Comments
 (0)