Skip to content

Commit 0474e17

Browse files
authored
Merge pull request #133 from litetex-oss/dev
Release
2 parents 86ccbe7 + 25c26b7 commit 0474e17

36 files changed

+544
-167
lines changed

.config/pmd/java/ruleset.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<rule ref="category/java/codestyle.xml/NoPackage"/>
4141
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
4242
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
43+
<rule ref="category/java/codestyle.xml/VariableCanBeInlined"/>
4344

4445
<rule ref="category/java/design.xml">
4546
<!-- Sometimes abstract classes have just fields -->
@@ -136,6 +137,7 @@
136137
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
137138
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
138139
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
140+
<rule ref="category/java/errorprone.xml/CollectionTypeMismatch"/>
139141
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
140142
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
141143
<rule ref="category/java/errorprone.xml/DontImportSun"/>
@@ -153,7 +155,7 @@
153155
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
154156
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
155157
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
156-
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
158+
<rule ref="category/java/errorprone.xml/UselessPureMethodCall"/>
157159

158160

159161
<rule ref="category/java/multithreading.xml">

.github/workflows/broken-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 15
1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717

1818
- run: mv .github/.lycheeignore .lycheeignore
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
22+
uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

.github/workflows/check-build.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,23 @@ jobs:
3131
distribution: [temurin]
3232

3333
steps:
34-
- uses: actions/checkout@v4
34+
- uses: actions/checkout@v5
3535

3636
- name: Set up JDK
37-
uses: actions/setup-java@v4
37+
uses: actions/setup-java@v5
3838
with:
3939
distribution: ${{ matrix.distribution }}
4040
java-version: ${{ matrix.java }}
41-
cache: 'gradle'
41+
42+
- name: Cache Gradle
43+
uses: actions/cache@v4
44+
with:
45+
path: |
46+
~/.gradle/caches
47+
~/.gradle/wrapper
48+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
49+
restore-keys: |
50+
${{ runner.os }}-gradle-build-
4251
4352
- name: Build
4453
run: ./gradlew build --info --stacktrace
@@ -72,7 +81,7 @@ jobs:
7281
!build/libs/*-javadoc.jar
7382
if-no-files-found: error
7483

75-
code-style:
84+
checkstyle:
7685
runs-on: ubuntu-latest
7786
if: ${{ github.event_name != 'pull_request' || !(startsWith(github.head_ref, 'renovate/') || startsWith(github.head_ref, 'automated/')) }}
7887
timeout-minutes: 10
@@ -82,14 +91,23 @@ jobs:
8291
distribution: [temurin]
8392

8493
steps:
85-
- uses: actions/checkout@v4
86-
94+
- uses: actions/checkout@v5
95+
8796
- name: Set up JDK
88-
uses: actions/setup-java@v4
97+
uses: actions/setup-java@v5
8998
with:
9099
distribution: ${{ matrix.distribution }}
91100
java-version: ${{ matrix.java }}
92-
cache: 'gradle'
101+
102+
- name: Cache Gradle
103+
uses: actions/cache@v4
104+
with:
105+
path: |
106+
~/.gradle/caches
107+
~/.gradle/wrapper
108+
key: ${{ runner.os }}-gradle-checkstyle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
109+
restore-keys: |
110+
${{ runner.os }}-gradle-checkstyle-
93111
94112
- name: Run Checkstyle
95113
run: ./gradlew checkstyleMain checkstyleTest -PcheckstyleEnabled=true
@@ -104,14 +122,23 @@ jobs:
104122
distribution: [temurin]
105123

106124
steps:
107-
- uses: actions/checkout@v4
125+
- uses: actions/checkout@v5
108126

109127
- name: Set up JDK
110-
uses: actions/setup-java@v4
128+
uses: actions/setup-java@v5
111129
with:
112130
distribution: ${{ matrix.distribution }}
113131
java-version: ${{ matrix.java }}
114-
cache: 'gradle'
132+
133+
- name: Cache Gradle
134+
uses: actions/cache@v4
135+
with:
136+
path: |
137+
~/.gradle/caches
138+
~/.gradle/wrapper
139+
key: ${{ runner.os }}-gradle-pmd-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
140+
restore-keys: |
141+
${{ runner.os }}-gradle-pmd-
115142
116143
- name: Run PMD
117144
run: ./gradlew pmdMain pmdTest -PpmdEnabled --stacktrace

.github/workflows/release.yml

Lines changed: 56 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 10
1515
steps:
16-
- uses: actions/checkout@v4
17-
16+
- uses: actions/checkout@v5
17+
1818
- name: Set up JDK
19-
uses: actions/setup-java@v4
19+
uses: actions/setup-java@v5
2020
with:
2121
java-version: '21'
2222
distribution: 'temurin'
23-
cache: 'gradle'
24-
23+
24+
- name: Try restore Gradle Cache
25+
uses: actions/cache/restore@v4
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-build-
33+
2534
- name: Build
2635
run: ./gradlew build --info
27-
36+
2837
- name: Check for uncommited changes
2938
run: |
3039
if [[ "$(git status --porcelain)" != "" ]]; then
@@ -50,13 +59,13 @@ jobs:
5059
outputs:
5160
upload_url: ${{ steps.create_release.outputs.upload_url }}
5261
steps:
53-
- uses: actions/checkout@v4
54-
62+
- uses: actions/checkout@v5
63+
5564
- name: Configure Git
5665
run: |
5766
git config --global user.email "actions@github.com"
5867
git config --global user.name "GitHub Actions"
59-
68+
6069
- name: UN-Snap version and output
6170
id: version
6271
run: |
@@ -71,21 +80,27 @@ jobs:
7180
7281
echo "Contents of gradle.properties"
7382
cat gradle.properties
74-
83+
7584
- name: Get metadata
7685
id: metadata
7786
run: |
78-
archives_base_name=$(grep -Po 'archives_base_name=\K.*' gradle.properties)
79-
echo "archives_base_name=$archives_base_name" >> $GITHUB_OUTPUT
80-
87+
archivesBaseName=$(grep -Po 'archivesBaseName=\K.*' gradle.properties)
88+
echo "archivesBaseName=$archivesBaseName" >> $GITHUB_OUTPUT
89+
8190
- name: Commit and Push
8291
run: |
8392
git add -A
8493
git commit -m "Release ${{ steps.version.outputs.release }}"
8594
git push origin
8695
git tag v${{ steps.version.outputs.release }}
8796
git push origin --tags
88-
97+
98+
- id: check-for-curseforge
99+
run: |
100+
[ -z $CURSEFORGE_TOKEN ] || echo "has=true" >> "$GITHUB_OUTPUT"
101+
env:
102+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
103+
89104
- name: Create Release
90105
id: create_release
91106
uses: shogo82148/actions-create-release@v1
@@ -99,31 +114,40 @@ jobs:
99114
100115
## Installation
101116
The mod can be downloaded from
102-
* [Modrinth](https://modrinth.com/mod/${{ steps.metadata.outputs.archives_base_name }})
103-
* [CurseForge](https://www.curseforge.com/minecraft/mc-mods/${{ steps.metadata.outputs.archives_base_name }})
117+
* [Modrinth](https://modrinth.com/mod/${{ steps.metadata.outputs.archivesBaseName }})
104118
* the GitHub release assets below
105119
* [Maven Central](https://repo.maven.apache.org/maven2/net/litetex/mcm/)
120+
${{ (steps.check-for-curseforge.outputs.has) && format('[CurseForge](https://www.curseforge.com/minecraft/mc-mods/{0})', steps.metadata.outputs.archivesBaseName) || '' }}
106121
107122
publish:
108123
runs-on: ubuntu-latest
109124
needs: [prepare_release]
110125
timeout-minutes: 60
111126
steps:
112-
- uses: actions/checkout@v4
113-
127+
- uses: actions/checkout@v5
128+
114129
- name: Set up JDK
115-
uses: actions/setup-java@v4
130+
uses: actions/setup-java@v5
116131
with:
117132
distribution: 'temurin'
118133
java-version: 21
119-
cache: 'gradle'
134+
135+
- name: Try restore Gradle Cache
136+
uses: actions/cache/restore@v4
137+
with:
138+
path: |
139+
~/.gradle/caches
140+
~/.gradle/wrapper
141+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
142+
restore-keys: |
143+
${{ runner.os }}-gradle-build-
120144
121145
- name: Init Git and pull
122146
run: |
123147
git config --global user.email "actions@github.com"
124148
git config --global user.name "GitHub Actions"
125149
git pull
126-
150+
127151
- name: Build and publish
128152
run: ./gradlew clean build modrinth --info --stacktrace
129153
env:
@@ -148,8 +172,15 @@ jobs:
148172
SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
149173
SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
150174

175+
- id: check-for-curseforge
176+
run: |
177+
[ -z $CURSEFORGE_TOKEN ] || echo "has=true" >> "$GITHUB_OUTPUT"
178+
env:
179+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
180+
151181
- name: Publish to CurseForge
152182
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 # v3
183+
if: ${{ steps.check-for-curseforge.outputs.has }}
153184
with:
154185
curseforge-id: 1291862
155186
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
@@ -162,14 +193,14 @@ jobs:
162193
needs: [publish]
163194
timeout-minutes: 10
164195
steps:
165-
- uses: actions/checkout@v4
166-
196+
- uses: actions/checkout@v5
197+
167198
- name: Init Git and pull
168199
run: |
169200
git config --global user.email "actions@github.com"
170201
git config --global user.name "GitHub Actions"
171202
git pull
172-
203+
173204
- name: Inc Version and SNAP root
174205
run: |
175206
originalVersion=$(grep -Po 'mod_version=\K.*' gradle.properties)
@@ -185,7 +216,7 @@ jobs:
185216
git add -A
186217
git commit -m "Preparing for next development iteration"
187218
git push origin
188-
219+
189220
- name: pull-request
190221
env:
191222
GH_TOKEN: ${{ github.token }}

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
timeout-minutes: 10
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
with:
2121
sparse-checkout: .github/labels.yml
2222

.github/workflows/test-deploy.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,24 @@ jobs:
88
runs-on: ubuntu-latest
99
timeout-minutes: 60
1010
steps:
11-
- uses: actions/checkout@v4
12-
11+
- uses: actions/checkout@v5
12+
1313
- name: Set up JDK
14-
uses: actions/setup-java@v4
14+
uses: actions/setup-java@v5
1515
with:
1616
distribution: 'temurin'
1717
java-version: '21'
18-
cache: 'gradle'
19-
18+
19+
- name: Try restore Gradle Cache
20+
uses: actions/cache/restore@v4
21+
with:
22+
path: |
23+
~/.gradle/caches
24+
~/.gradle/wrapper
25+
key: ${{ runner.os }}-gradle-build-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
26+
restore-keys: |
27+
${{ runner.os }}-gradle-build-
28+
2029
- name: Build and publish
2130
run: ./gradlew clean build modrinth --info --stacktrace
2231
env:
@@ -43,8 +52,15 @@ jobs:
4352
SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_USERNAME }}
4453
SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN: ${{ secrets.SONATYPE_MAVEN_CENTRAL_PORTAL_TOKEN }}
4554

55+
- id: check-for-curseforge
56+
run: |
57+
[ -z $CURSEFORGE_TOKEN ] || echo "has=true" >> "$GITHUB_OUTPUT"
58+
env:
59+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
60+
4661
- name: Publish to CurseForge
4762
uses: Kira-NT/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 # v3
63+
if: ${{ steps.check-for-curseforge.outputs.has }}
4864
with:
4965
curseforge-id: 1291862
5066
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

.github/workflows/update-from-template.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ jobs:
3636
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
3737
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v5
4040
with:
4141
# Required because otherwise there are always changes detected when executing diff/rev-list
4242
fetch-depth: 0
4343
# If no PAT is used the following error occurs on a push:
4444
# refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
4545
token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
46-
46+
4747
- name: Init Git
4848
run: |
4949
git config --global user.email "164098849+litetex-oss-bot@users.noreply.github.com"
@@ -183,14 +183,14 @@ jobs:
183183
runs-on: ubuntu-latest
184184
timeout-minutes: 60
185185
steps:
186-
- uses: actions/checkout@v4
186+
- uses: actions/checkout@v5
187187
with:
188188
# Required because otherwise there are always changes detected when executing diff/rev-list
189189
fetch-depth: 0
190190
# If no PAT is used the following error occurs on a push:
191191
# refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
192192
token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
193-
193+
194194
- name: Init Git
195195
run: |
196196
git config --global user.email "164098849+litetex-oss-bot@users.noreply.github.com"

0 commit comments

Comments
 (0)