Skip to content

Commit 5806400

Browse files
authored
Update deps to latest (#4)
* Update deps to latest * Update CHANGELOG * Use incrementMinorIfNotOnRelease version incementer
1 parent 4af754c commit 5806400

File tree

10 files changed

+244
-215
lines changed

10 files changed

+244
-215
lines changed

.github/workflows/pr-workflow.yml

+5-14
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,11 @@ jobs:
66
name: Gradle Build
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v1
10-
- uses: actions/setup-java@v1
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-java@v2
1111
with:
12-
java-version: 11
13-
- uses: actions/cache@v1
14-
with:
15-
path: ~/.gradle/wrapper
16-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
17-
- uses: actions/cache@v1
18-
with:
19-
path: ~/.gradle/caches
20-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
21-
restore-keys: |
22-
${{ runner.os }}-gradle-caches-
23-
- uses: eskatos/gradle-command-action@v1
12+
java-version: 17
13+
distribution: temurin
14+
- uses: gradle/gradle-build-action@v2
2415
with:
2516
arguments: build

.github/workflows/release-workflow.yml

+8-7
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,28 @@ jobs:
99
name: Create Release
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v1
13-
- uses: actions/setup-java@v1
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-java@v2
1414
with:
15-
java-version: 11
15+
java-version: 17
16+
distribution: temurin
1617
- name: Gradle Build
17-
uses: eskatos/gradle-command-action@v1
18+
uses: gradle/gradle-build-action@v2
1819
with:
1920
arguments: build
2021
- name: Extract version
21-
uses: frabert/replace-string-action@master
22+
uses: frabert/replace-string-action@v2.0
2223
id: format-version
2324
with:
2425
pattern: 'refs/tags/release-([0-9]+.[0-9]+.[0-9]+)'
2526
string: ${{ github.ref }}
2627
replace-with: '$1'
2728
- name: Release
28-
uses: docker://antonyurchenko/git-release:v3
29+
uses: docker://antonyurchenko/git-release:v4.1
2930
env:
3031
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3132
DRAFT_RELEASE: "true"
32-
ALLOW_TAG_PREFIX: "true"
33+
TAG_PREFIX_REGEX: "release-"
3334
with:
3435
args: |
3536
build/libs/simplenpcs-${{ steps.format-version.outputs.replaced }}.jar

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Changed
5+
- Update gradle to 7.4
6+
- Update to Spigot/MC 1.18
7+
- Update to Java 17
48

59
## [0.1.0] - 2020-02-16
610
### Added
@@ -10,4 +14,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1014
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1115

1216
[Unreleased]: https://github.com/SimpleMC/SimpleNPCs/compare/release-0.1.0...HEAD
13-
[0.1.0]: https://github.com/SimpleMC/SimpleNPCs/releases/tag/release-0.1.0
17+
[0.1.0]: https://github.com/SimpleMC/SimpleNPCs/releases/tag/release-0.1.0

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Simple "NPC" interaction plugin for binding commands to entities
44
## Features
55

66
- Simple, composable entity interactions via command binding
7+
- Anything that can be done via a command can be easily turned into an NPC interaction
78

89
## Config Overview
910
```yaml

build.gradle.kts

+62-65
Original file line numberDiff line numberDiff line change
@@ -6,80 +6,77 @@ import java.time.ZoneOffset
66
import java.time.format.DateTimeFormatter
77

88
plugins {
9-
kotlin("jvm") version "1.3.61"
10-
id("com.github.johnrengelman.shadow") version "5.2.0"
11-
id("pl.allegro.tech.build.axion-release") version "1.10.3"
12-
id("org.jlleitschuh.gradle.ktlint") version "9.1.1"
9+
kotlin("jvm") version "1.6.10"
10+
id("com.github.johnrengelman.shadow") version "7.1.2"
11+
id("pl.allegro.tech.build.axion-release") version "1.13.6"
12+
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
1313
}
1414

1515
val repoRef = "SimpleMC\\/SimpleNPCs"
16-
val mcApiVersion = "1.15"
16+
val mcApiVersion = "1.18"
1717

1818
group = "org.simplemc"
1919
version = scmVersion.version
2020

2121
scmVersion {
22-
hooks(closureOf<HooksConfig> {
23-
pre(
24-
"fileUpdate",
25-
mapOf(
26-
"file" to "src/main/resources/plugin.yml",
27-
"pattern" to KotlinClosure2<String, HookContext, String>({ v, _ -> "version: $v\\napi-version: \".+\"" }),
28-
"replacement" to KotlinClosure2<String, HookContext, String>({ v, _ -> "version: $v\napi-version: \"$mcApiVersion\"" })
29-
)
30-
)
31-
// "normal" changelog update--changelog already contains a history
32-
pre(
33-
"fileUpdate",
34-
mapOf(
35-
"file" to "CHANGELOG.md",
36-
"pattern" to KotlinClosure2<String, HookContext, String>({ v, _ ->
37-
"\\[Unreleased\\]([\\s\\S]+?)\\n(?:^\\[Unreleased\\]: https:\\/\\/github\\.com\\/$repoRef\\/compare\\/release-$v\\.\\.\\.HEAD\$([\\s\\S]*))?\\z"
38-
}),
39-
"replacement" to KotlinClosure2<String, HookContext, String>({ v, c ->
40-
"""
41-
\[Unreleased\]
42-
43-
## \[$v\] - ${currentDateString()}$1
44-
\[Unreleased\]: https:\/\/github\.com\/$repoRef\/compare\/release-$v...HEAD
45-
\[$v\]: https:\/\/github\.com\/$repoRef\/compare\/release-${c.previousVersion}...release-$v$2
46-
""".trimIndent()
47-
})
22+
versionIncrementer("incrementMinorIfNotOnRelease", mapOf("releaseBranchPattern" to "release/.+"))
23+
24+
hooks(
25+
closureOf<HooksConfig> {
26+
// "normal" changelog update--changelog already contains a history
27+
pre(
28+
"fileUpdate",
29+
mapOf(
30+
"file" to "CHANGELOG.md",
31+
"pattern" to KotlinClosure2<String, HookContext, String>({ v, _ ->
32+
"\\[Unreleased\\]([\\s\\S]+?)\\n(?:^\\[Unreleased\\]: https:\\/\\/github\\.com\\/$repoRef\\/compare\\/release-$v\\.\\.\\.HEAD\$([\\s\\S]*))?\\z"
33+
}),
34+
"replacement" to KotlinClosure2<String, HookContext, String>({ v, c ->
35+
"""
36+
\[Unreleased\]
37+
38+
## \[$v\] - ${currentDateString()}$1
39+
\[Unreleased\]: https:\/\/github\.com\/$repoRef\/compare\/release-$v...HEAD
40+
\[$v\]: https:\/\/github\.com\/$repoRef\/compare\/release-${c.previousVersion}...release-$v$2
41+
""".trimIndent()
42+
})
43+
)
4844
)
49-
)
50-
// first-time changelog update--changelog has only unreleased info
51-
pre(
52-
"fileUpdate",
53-
mapOf(
54-
"file" to "CHANGELOG.md",
55-
"pattern" to KotlinClosure2<String, HookContext, String>({ v, _ ->
56-
"Unreleased([\\s\\S]+?\\nand this project adheres to \\[Semantic Versioning\\]\\(https:\\/\\/semver\\.org\\/spec\\/v2\\.0\\.0\\.html\\).)\\s\\z"
57-
}),
58-
"replacement" to KotlinClosure2<String, HookContext, String>({ v, c ->
59-
"""
60-
\[Unreleased\]
61-
62-
## \[$v\] - ${currentDateString()}$1
63-
64-
\[Unreleased\]: https:\/\/github\.com\/$repoRef\/compare\/release-$v...HEAD
65-
\[$v\]: https:\/\/github\.com\/$repoRef\/releases\/tag\/release-$v
66-
""".trimIndent()
67-
})
45+
// first-time changelog update--changelog has only unreleased info
46+
pre(
47+
"fileUpdate",
48+
mapOf(
49+
"file" to "CHANGELOG.md",
50+
"pattern" to KotlinClosure2<String, HookContext, String>({ _, _ ->
51+
"Unreleased([\\s\\S]+?\\nand this project adheres to \\[Semantic Versioning\\]\\(https:\\/\\/semver\\.org\\/spec\\/v2\\.0\\.0\\.html\\).)\\s\\z"
52+
}),
53+
"replacement" to KotlinClosure2<String, HookContext, String>({ v, _ ->
54+
"""
55+
\[Unreleased\]
56+
57+
## \[$v\] - ${currentDateString()}$1
58+
59+
\[Unreleased\]: https:\/\/github\.com\/$repoRef\/compare\/release-$v...HEAD
60+
\[$v\]: https:\/\/github\.com\/$repoRef\/releases\/tag\/release-$v
61+
""".trimIndent()
62+
})
63+
)
6864
)
69-
)
70-
pre("commit")
71-
})
65+
pre("commit")
66+
}
67+
)
7268
}
7369

7470
fun currentDateString() = OffsetDateTime.now(ZoneOffset.UTC).toLocalDate().format(DateTimeFormatter.ISO_DATE)
7571

7672
java {
77-
sourceCompatibility = JavaVersion.VERSION_11
78-
targetCompatibility = JavaVersion.VERSION_11
73+
toolchain {
74+
languageVersion.set(JavaLanguageVersion.of(17))
75+
}
7976
}
8077

8178
repositories {
82-
jcenter()
79+
mavenCentral()
8380
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
8481
maven("https://oss.sonatype.org/content/repositories/snapshots")
8582
}
@@ -89,20 +86,20 @@ dependencies {
8986
compileOnly(group = "org.spigotmc", name = "spigot-api", version = "$mcApiVersion+")
9087
}
9188

92-
ktlint {
93-
// FIXME - ktlint bug(?): https://github.com/pinterest/ktlint/issues/527
94-
disabledRules.set(listOf("import-ordering"))
95-
}
96-
9789
tasks {
9890
wrapper {
99-
gradleVersion = "6.1.1"
91+
gradleVersion = "7.4.1"
10092
distributionType = Wrapper.DistributionType.ALL
10193
}
10294

103-
compileKotlin {
104-
kotlinOptions {
105-
jvmTarget = "1.8"
95+
processResources {
96+
val placeholders = mapOf(
97+
"version" to version,
98+
"apiVersion" to mcApiVersion
99+
)
100+
101+
filesMatching("plugin.yml") {
102+
expand(placeholders)
106103
}
107104
}
108105

gradle/wrapper/gradle-wrapper.jar

4.11 KB
Binary file not shown.
+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.1.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)