Skip to content

Commit ce0912b

Browse files
KiriCattusKiriCattus
authored andcommitted
Some minor gradle setup updates.
1 parent 2aacd94 commit ce0912b

23 files changed

Lines changed: 758 additions & 481 deletions

.editorconfig

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,16 @@
11
root = true
22

33
[*]
4-
charset = utf-8
54
end_of_line = lf
65
insert_final_newline = true
7-
tab_width = 4
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 4
89
trim_trailing_whitespace = true
10+
max_line_length = 120
911

1012
[*.md]
1113
trim_trailing_whitespace = false
1214

13-
[*.gradle]
14-
indent_style = tab
15-
16-
[*.java]
17-
indent_style = space
18-
indent_size = 4
19-
20-
[*.json]
21-
indent_style = space
22-
indent_size = 2
23-
24-
[quilt.mod.json]
25-
indent_style = tab
26-
tab_width = 2
27-
28-
[*.toml]
29-
indent_style = tab
30-
tab_width = 2
31-
32-
[*.properties]
33-
indent_style = space
15+
[*.{json,toml,properties,yml}]
3416
indent_size = 2

.gitattributes

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
1-
*.java text eol=lf diff=java
2-
*.gradle text eol=lf diff=java
3-
*.kt text eol=lf diff=kotlin
4-
*.kts text eol=lf diff=kotlin
5-
gradlew text eol=lf
6-
*.bat text eol=crlf
7-
8-
*.md text eol=lf diff=markdown
9-
10-
.editorconfig text eol=lf
11-
12-
*.json text eol=lf
13-
*.json5 text eol=lf
14-
*.properties text eol=lf
15-
*.toml text eol=lf
16-
*.xml text eol=lf diff=html
17-
18-
# Modding specific
19-
*.accesswidener text eol=lf
20-
21-
# These files are binary and should be left untouched
22-
# (binary is a macro for -text -diff)
23-
*.class binary
24-
*.dll binary
25-
*.ear binary
26-
*.jar binary
27-
*.jks binary
28-
*.png binary
29-
*.so binary
30-
*.war binary
1+
* text eol=lf
2+
*.bat text eol=crlf
3+
*.patch text eol=lf
4+
*.java text eol=lf
5+
*.gradle text eol=crlf
6+
*.png binary
7+
*.gif binary
8+
*.exe binary
9+
*.dll binary
10+
*.jar binary
11+
*.lzma binary
12+
*.zip binary
13+
*.pyd binary
14+
*.cfg text eol=lf
15+
*.jks binary

.github/workflows/build_status.yml

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,65 @@
1-
name: Run a test build.
1+
name: Build Status
22

33
on:
44
push:
5-
branches:
6-
- dev
75
paths-ignore:
86
- '*.md'
97
pull_request:
10-
branches:
11-
- dev
128
paths-ignore:
139
- '*.md'
1410

11+
env:
12+
JAVA_VERSION: 21
13+
1514
jobs:
1615
build:
1716
runs-on: ubuntu-latest
1817
steps:
1918
- name: Checkout latest commit.
2019
uses: actions/checkout@v4
2120

22-
- name: Set up JDK 17
23-
uses: actions/setup-java@v3
21+
- name: Set up JDK ${{ env.JAVA_VERSION }}
22+
uses: actions/setup-java@v4
2423
with:
25-
distribution: temurin
26-
java-version: 17
24+
java-version: ${{ env.JAVA_VERSION }}
25+
distribution: 'microsoft'
26+
cache: 'gradle'
2727

28-
- name: Grant execute permission for gradlew
29-
run: chmod +x ./gradlew
28+
- name: Validate Gradle Wrapper
29+
uses: gradle/actions/wrapper-validation@v4
3030

31-
- name: Setup Gradle
32-
uses: gradle/actions/setup-gradle@v3
33-
with:
34-
gradle-version: 8.1.1
31+
- name: Grant Gradle execute permissions
32+
run: chmod +x ./gradlew
3533

3634
- name: Build with Gradle
3735
run: ./gradlew build
36+
37+
- name: Upload build artifacts (Common)
38+
continue-on-error: true
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: ${{ github.event.repository.name }}-common-${{ github.sha }}
42+
path: |
43+
common/build/libs/*.jar
44+
!common/build/libs/*-dev.jar
45+
46+
- name: Upload build artifacts (NeoForge)
47+
continue-on-error: true
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ${{ github.event.repository.name }}-neoforge-${{ github.sha }}
51+
path: |
52+
neoforge/build/libs/*.jar
53+
!neoforge/build/libs/*-dev.jar
54+
55+
- name: Upload build artifacts (Fabric)
56+
continue-on-error: true
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: ${{ github.event.repository.name }}-fabric-${{ github.sha }}
60+
path: |
61+
fabric/build/libs/*.jar
62+
!fabric/build/libs/*-dev.jar
63+
64+
- name: Run tests
65+
run: ./gradlew check

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Upload Release Artifacts
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
BUILD_NUMBER: ${{ github.run_number }}
10+
JAVA_VERSION: 21
11+
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
12+
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
13+
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
14+
TAG: ${{ github.ref_name }}
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout latest commit.
21+
uses: actions/checkout@v4
22+
23+
- name: Get time of build
24+
uses: srfrnk/current-time@master
25+
id: current-time
26+
with:
27+
format: YYYYMMDDHHmmss
28+
29+
- name: Set up JDK ${{ env.JAVA_VERSION }}
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: ${{ env.JAVA_VERSION }}
33+
distribution: 'microsoft'
34+
cache: 'gradle'
35+
36+
- name: Validate Gradle Wrapper
37+
uses: gradle/actions/wrapper-validation@v4
38+
39+
- name: Grant execute permission for gradlew
40+
run: chmod +x ./gradlew
41+
42+
- name: Build with Gradle
43+
env:
44+
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }}
45+
run: ./gradlew assemble
46+
47+
- name: Maven Release
48+
if: ${{ env.MAVEN_UPLOAD_URL }}
49+
run: ./gradlew publish
50+
51+
- name: Publish (GitHub Releases)
52+
id: publish_github
53+
uses: Kir-Antipov/mc-publish@v3.3
54+
with:
55+
github-token: ${{ github.token }}
56+
version: ${{ env.TAG }}
57+
files: |
58+
**/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
59+
**/build/libs/*-@(sources|javadoc).jar
60+
61+
- name: Publish (NeoForge)
62+
id: publish_neoforge
63+
uses: Kir-Antipov/mc-publish@v3.3
64+
with:
65+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
66+
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
67+
version: ${{ env.TAG }}+neoforge
68+
files: |
69+
neoforge/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
70+
neoforge/build/libs/*-@(sources|javadoc).jar
71+
72+
- name: Publish (Fabric)
73+
id: publish_fabric
74+
uses: Kir-Antipov/mc-publish@v3.3
75+
with:
76+
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
77+
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
78+
version: ${{ env.TAG }}+fabric
79+
files: |
80+
fabric/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
81+
fabric/build/libs/*-@(sources|javadoc).jar
82+
83+
- name: Post to BlueSky
84+
uses: myConsciousness/bluesky-post@v5
85+
with:
86+
text: "It's update time! :D
87+
An update has been released for Mysterious Biomes via [CurseForge](https://www.curseforge.com/minecraft/mc-mods/mysterious-biomes) and [Modrinth](https://modrinth.com/mod/mysterious-biomes)! [Check out my other mods here!](https://tophatcat.dev)"
88+
tags: "modding,minecraft,mods"
89+
retry-count: 5
90+
identifier: ${{ secrets.BLUESKY_IDENTIFIER }}
91+
password: ${{ secrets.BLUESKY_PASSWORD }}
92+
93+
- name: Post to Discord
94+
uses: Up-Mods/action-discord-release@main
95+
with:
96+
version: ${{ env.TAG }}
97+
webhook-url: ${{ secrets.ANNOUNCEMENT_WEBHOOK_URL }}
98+
curseforge-project-id: ${{ steps.publish_fabric.outputs.curseforge-id }}
99+
modrinth-project-id: ${{ steps.publish_fabric.outputs.modrinth-id }}
100+
thumbnail-url: https://raw.githubusercontent.com/kiris-mods/mysterious-biomes/refs/heads/dev/common/src/main/resources/logo.png

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ out
1313
*.iws
1414
*.iml
1515
.idea/*
16+
buildSrc/src/main/groovy/.idea/*
1617
!.idea/scopes
1718

1819
# Gradle
@@ -23,6 +24,8 @@ build
2324
eclipse
2425
run
2526
runs
27+
*/reports/*
28+
TODO.txt
2629

2730
# Visual Studio Code
2831
.settings/
@@ -31,3 +34,6 @@ bin/
3134

3235
# MacOS
3336
*.DS_Store
37+
/common/src/generated/resources/.cache
38+
buildSrc/build
39+
buildSrc/.gradle

LICENSE.txt renamed to LICENSE.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -164,28 +164,28 @@ fee.
164164
distribute such modifications or work under the terms of Section 1
165165
above, provided that you also meet all of these conditions:
166166

167-
a) The modified work must itself be a software library.
167+
a) The modified work must itself be a software library.
168168

169-
b) You must cause the files modified to carry prominent notices
170-
stating that you changed the files and the date of any change.
169+
b) You must cause the files modified to carry prominent notices
170+
stating that you changed the files and the date of any change.
171171

172-
c) You must cause the whole of the work to be licensed at no
173-
charge to all third parties under the terms of this License.
172+
c) You must cause the whole of the work to be licensed at no
173+
charge to all third parties under the terms of this License.
174174

175-
d) If a facility in the modified Library refers to a function or a
176-
table of data to be supplied by an application program that uses
177-
the facility, other than as an argument passed when the facility
178-
is invoked, then you must make a good faith effort to ensure that,
179-
in the event an application does not supply such function or
180-
table, the facility still operates, and performs whatever part of
181-
its purpose remains meaningful.
175+
d) If a facility in the modified Library refers to a function or a
176+
table of data to be supplied by an application program that uses
177+
the facility, other than as an argument passed when the facility
178+
is invoked, then you must make a good faith effort to ensure that,
179+
in the event an application does not supply such function or
180+
table, the facility still operates, and performs whatever part of
181+
its purpose remains meaningful.
182182

183-
(For example, a function in a library to compute square roots has
184-
a purpose that is entirely well-defined independent of the
185-
application. Therefore, Subsection 2d requires that any
186-
application-supplied function or table used by this function must
187-
be optional: if the application does not supply it, the square
188-
root function must still compute square roots.)
183+
(For example, a function in a library to compute square roots has
184+
a purpose that is entirely well-defined independent of the
185+
application. Therefore, Subsection 2d requires that any
186+
application-supplied function or table used by this function must
187+
be optional: if the application does not supply it, the square
188+
root function must still compute square roots.)
189189

190190
These requirements apply to the modified work as a whole. If
191191
identifiable sections of that work are not derived from the Library,
@@ -337,14 +337,14 @@ distribute.
337337
the Library and of the other library facilities is otherwise
338338
permitted, and provided that you do these two things:
339339

340-
a) Accompany the combined library with a copy of the same work
341-
based on the Library, uncombined with any other library
342-
facilities. This must be distributed under the terms of the
343-
Sections above.
340+
a) Accompany the combined library with a copy of the same work
341+
based on the Library, uncombined with any other library
342+
facilities. This must be distributed under the terms of the
343+
Sections above.
344344

345-
b) Give prominent notice with the combined library of the fact
346-
that part of it is a work based on the Library, and explaining
347-
where to find the accompanying uncombined form of the same work.
345+
b) Give prominent notice with the combined library of the fact
346+
that part of it is a work based on the Library, and explaining
347+
where to find the accompanying uncombined form of the same work.
348348

349349
8. You may not copy, modify, sublicense, link with, or distribute
350350
the Library except as expressly provided under this License. Any

LICENSE_HEADER.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
${project_information}
2+
Copyright (C) ${name} ${year}
3+
${license_link}
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
18+
USA

0 commit comments

Comments
 (0)