Skip to content

Commit 87a5449

Browse files
committed
build: Bump gradle to 6.7.1, switch to indra
1 parent 800e9e6 commit 87a5449

File tree

5 files changed

+49
-101
lines changed

5 files changed

+49
-101
lines changed

.github/workflows/build.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@ on: ["pull_request", "push"]
44

55
jobs:
66
build:
7+
# Only run on PRs if the source branch is on someone else's repo
8+
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.repository.full_name }}
79
strategy:
810
matrix:
9-
java: ["1.8", "11", "15"]
1011
os: ["ubuntu-latest", "windows-latest"]
1112
runs-on: "${{ matrix.os }}"
1213
steps:
1314
- name: "checkout repository"
1415
uses: "actions/checkout@v2"
15-
- name: "setup jdk ${{ matrix.java }}"
16+
- name: "setup jdk 11"
1617
uses: "actions/setup-java@v1"
1718
with:
18-
java-version: "${{ matrix.java }}"
19-
- name: Cache Gradle packages
20-
uses: actions/cache@v1
21-
with:
22-
path: ~/.gradle/caches
23-
key: ${{ runner.os }}-${{matrix.java}}-gradle-${{ hashFiles('**/*.gradle') }}
24-
restore-keys: ${{ runner.os }}-${{matrix.java}}-gradle
19+
java-version: "11"
2520
- name: "build"
26-
run: "./gradlew build --stacktrace"
21+
run: "./gradlew build"
22+
- name: "publish"
23+
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
24+
run: "./gradlew publish"
25+
env:
26+
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
27+
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/publish.yml

-19
This file was deleted.

build.gradle

+37-71
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
1+
import net.kyori.indra.Indra
2+
3+
buildscript {
4+
ext {
5+
indraVersion = "1.2.0"
6+
}
7+
}
8+
19
plugins {
2-
id 'java-library'
3-
id 'maven-publish'
4-
id 'signing'
5-
id 'net.kyori.invent' version '1.0.4'
6-
id 'net.kyori.invent-javadoc-jar' version '1.0.4'
7-
id 'net.kyori.invent-sonatype-repository' version '1.0.4'
8-
id 'net.kyori.invent-sources-jar' version '1.0.4'
9-
id 'net.minecrell.licenser' version '0.4.1'
10+
id 'net.kyori.indra' version "$indraVersion"
11+
id 'net.kyori.indra.publishing.sonatype' version "$indraVersion"
12+
id 'net.kyori.indra.license-header' version "$indraVersion"
1013
}
1114

1215
group 'net.kyori'
1316
version '4.0.0-SNAPSHOT'
1417
description 'A pagination feature for Adventure.'
1518

16-
tasks.withType(JavaCompile) {
17-
options.compilerArgs += ['-Xlint:all']
18-
}
19-
20-
license {
21-
header rootProject.file('header.txt')
22-
include '**/*.java'
23-
newLine false
24-
}
25-
2619
repositories {
2720
mavenLocal()
2821
mavenCentral()
29-
maven {
30-
url 'https://oss.sonatype.org/content/groups/public/'
31-
}
22+
sonatypeSnapshots()
3223
}
3324

3425
dependencies {
@@ -46,68 +37,43 @@ jar {
4637
)
4738
}
4839

49-
inventSonatypeRepository.enabled = System.getenv('GITHUB_ACTIONS') == null || project.version.endsWith('-SNAPSHOT')
50-
51-
publishing {
52-
publications {
53-
maven(MavenPublication) {
54-
from components.java
55-
56-
artifact javadocJar
57-
artifact sourcesJar
58-
59-
pom {
60-
name = project.name
61-
url = 'https://github.com/KyoriPowered/adventure-text-feature-pagination'
62-
description = project.description
63-
64-
developers {
65-
developer {
66-
id = 'kashike'
67-
timezone = 'America/Vancouver'
68-
}
69-
70-
developer {
71-
id = 'lucko'
72-
name = 'Luck'
73-
url = 'https://lucko.me'
74-
75-
}
40+
indra {
41+
javaVersions {
42+
testWith(8, 11, 15)
43+
}
7644

77-
developer {
78-
id = 'zml'
79-
name = 'zml'
80-
timezone = 'America/Vancouver'
81-
}
45+
github("KyoriPowered", "adventure-text-feature-pagination")
46+
mitLicense()
8247

83-
developer {
84-
id = 'Electroid'
85-
}
48+
configurePublications {
49+
pom {
50+
developers {
51+
developer {
52+
id = 'kashike'
53+
timezone = 'America/Vancouver'
8654
}
8755

88-
issueManagement {
89-
system = 'GitHub Issues'
90-
url = 'https://github.com/KyoriPowered/adventure-text-feature-pagination/issues'
56+
developer {
57+
id = 'lucko'
58+
name = 'Luck'
59+
url = 'https://lucko.me'
60+
9161
}
9262

93-
licenses {
94-
license {
95-
name = 'MIT License'
96-
url = 'https://opensource.org/licenses/MIT'
97-
}
63+
developer {
64+
id = 'zml'
65+
name = 'zml'
66+
timezone = 'America/Vancouver'
9867
}
9968

100-
scm {
101-
connection = 'scm:[email protected]:KyoriPowered/adventure-text-feature-pagination.git'
102-
developerConnection = 'scm:[email protected]:KyoriPowered/adventure-text-feature-pagination.git'
103-
url = 'https://github.com/KyoriPowered/adventure-text-feature-pagination/'
69+
developer {
70+
id = 'Electroid'
10471
}
10572
}
10673
}
10774
}
10875
}
10976

110-
signing {
111-
required { project.hasProperty('signing.keyId') && gradle.taskGraph.hasTask(':publish') && !project.version.endsWith('-SNAPSHOT') }
112-
sign publishing.publications.maven
77+
tasks.withType(Sign) {
78+
onlyIf { project.hasProperty('signing.keyId') && Indra.isRelease(project) }
11379
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

header.txt license_header.txt

File renamed without changes.

0 commit comments

Comments
 (0)