Skip to content

Commit aada99f

Browse files
committed
refactor: gitignore .idea
1 parent 42981e3 commit aada99f

File tree

6 files changed

+162
-0
lines changed

6 files changed

+162
-0
lines changed

.github/workflows/release-dev.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release on Modrinth
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: Build ShadowJars and Create Release
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
with:
18+
ref: main
19+
20+
- name: Set up JDK 21
21+
uses: actions/setup-java@v3
22+
with:
23+
distribution: 'adopt'
24+
java-version: '21'
25+
26+
- name: Cache Gradle packages
27+
uses: actions/cache@v3
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
33+
restore-keys: |
34+
gradle-${{ runner.os }}
35+
36+
- name: Make gradlew executable
37+
run: chmod +x ./gradlew
38+
39+
- name: Build ShadowJars
40+
run: ./gradlew clean build shadowJar
41+
42+
- name: Get Gradle Version
43+
id: gradle_version
44+
run: echo "GRADLE_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV
45+
46+
- name: Get Commit Hash
47+
id: commit_hash
48+
run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
49+
50+
- name: Publish to Modrinth
51+
run: ./gradlew modrinth && ./gradlew modrinthSyncBody
52+
env:
53+
COMMIT_HASH: ${{ env.COMMIT_HASH }}
54+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
55+
- name: Create Release
56+
id: create_release
57+
uses: actions/create-release@v1
58+
with:
59+
tag_name: v${{ env.GRADLE_VERSION }}-dev.${{ env.COMMIT_HASH }}
60+
release_name: v${{ env.GRADLE_VERSION }}-dev.${{ env.COMMIT_HASH }}
61+
draft: false
62+
prerelease: true
63+
commitish: develop
64+
body: |
65+
This release contains dev builds for all Gradle modules.
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Upload ShadowJars to Release
70+
run: |
71+
# Find JAR files in any submodule's build/libs directory
72+
for jar in $(find . -type f -name "*.jar" -path "*/build/libs/*.jar" -not -path "./build/libs/*"); do
73+
# Check if the filename contains a version number (e.g., a dash followed by numbers)
74+
if [[ $(basename "$jar") =~ -[0-9]+\.[0-9]+ ]]; then
75+
echo "Skipping $jar due to version number"
76+
else
77+
echo "Uploading $jar"
78+
gh release upload v${{ env.GRADLE_VERSION }}-dev.${{ env.COMMIT_HASH }} "$jar"
79+
fi
80+
done
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id("java")
55
alias(libs.plugins.shadow)
66
alias(libs.plugins.kotlin.jvm)
7+
alias(libs.plugins.minotaur)
78
}
89

910
group = "app.simplecloud.api"
@@ -25,6 +26,7 @@ subprojects {
2526
apply {
2627
plugin(rootProject.libs.plugins.shadow.get().pluginId)
2728
plugin(rootProject.libs.plugins.kotlin.jvm.get().pluginId)
29+
plugin(rootProject.libs.plugins.minotaur.get().pluginId)
2830
}
2931
java {
3032
toolchain.languageVersion.set(JavaLanguageVersion.of(21))

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ shadow = "8.3.3"
77
simplecloud-controller = "0.0.30-SNAPSHOT.2660ec8"
88
simplecloud-player = "0.0.1-SNAPSHOT.d490b2f"
99
paper = "1.21.4-R0.1-SNAPSHOT"
10+
minotaur = "2.8.7"
1011

1112
[libraries]
1213
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
@@ -21,3 +22,4 @@ bungeecord = { module = "net.md-5:bungeecord-api", version.ref = "bungeecord" }
2122
[plugins]
2223
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2324
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
25+
minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" }

platform/bungeecord/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,29 @@ tasks.named("shadowJar", ShadowJar::class) {
2424
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
2525

2626
archiveFileName.set("${rootProject.name}.jar")
27+
}
28+
29+
modrinth {
30+
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
31+
projectId.set("JCJKZvY2")
32+
versionNumber.set(rootProject.version.toString())
33+
versionType.set("beta")
34+
uploadFile.set(tasks.shadowJar)
35+
gameVersions.addAll(
36+
"1.20",
37+
"1.20.1",
38+
"1.20.2",
39+
"1.20.3",
40+
"1.20.4",
41+
"1.20.5",
42+
"1.20.6",
43+
"1.21",
44+
"1.21.1",
45+
"1.21.2",
46+
"1.21.3",
47+
"1.21.4"
48+
)
49+
loaders.add("bungeecord")
50+
changelog.set("https://docs.simplecloud.app/changelog")
51+
syncBodyFrom.set(rootProject.file("README.md").readText())
2752
}

platform/spigot/build.gradle.kts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,30 @@ tasks.named("shadowJar", ShadowJar::class) {
2626
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
2727

2828
archiveFileName.set("${rootProject.name}.jar")
29+
}
30+
31+
modrinth {
32+
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
33+
projectId.set("JCJKZvY2")
34+
versionNumber.set(rootProject.version.toString())
35+
versionType.set("beta")
36+
uploadFile.set(tasks.shadowJar)
37+
gameVersions.addAll(
38+
"1.20",
39+
"1.20.1",
40+
"1.20.2",
41+
"1.20.3",
42+
"1.20.4",
43+
"1.20.5",
44+
"1.20.6",
45+
"1.21",
46+
"1.21.1",
47+
"1.21.2",
48+
"1.21.3",
49+
"1.21.4"
50+
)
51+
loaders.add("spigot")
52+
loaders.add("paper")
53+
changelog.set("https://docs.simplecloud.app/changelog")
54+
syncBodyFrom.set(rootProject.file("README.md").readText())
2955
}

platform/velocity/build.gradle.kts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,29 @@ tasks.named("shadowJar", ShadowJar::class) {
2727
relocate("io.grpc", "app.simplecloud.relocate.io.grpc")
2828

2929
archiveFileName.set("${rootProject.name}.jar")
30+
}
31+
32+
modrinth {
33+
token.set(project.findProperty("modrinthToken") as String? ?: System.getenv("MODRINTH_TOKEN"))
34+
projectId.set("JCJKZvY2")
35+
versionNumber.set(rootProject.version.toString())
36+
versionType.set("beta")
37+
uploadFile.set(tasks.shadowJar)
38+
gameVersions.addAll(
39+
"1.20",
40+
"1.20.1",
41+
"1.20.2",
42+
"1.20.3",
43+
"1.20.4",
44+
"1.20.5",
45+
"1.20.6",
46+
"1.21",
47+
"1.21.1",
48+
"1.21.2",
49+
"1.21.3",
50+
"1.21.4"
51+
)
52+
loaders.add("velocity")
53+
changelog.set("https://docs.simplecloud.app/changelog")
54+
syncBodyFrom.set(rootProject.file("README.md").readText())
3055
}

0 commit comments

Comments
 (0)