-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feature(actions): adjust how template cloning works and bump gradle
- Loading branch information
1 parent
0d03227
commit 9047262
Showing
23 changed files
with
324 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = tab | ||
tab_width = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.gradle] | ||
indent_style = tab | ||
|
||
[*.java] | ||
indent_style = tab | ||
ij_continuation_indent_size = 8 | ||
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,*,|,net.minecraft.**,|,org.polyfrost.** | ||
ij_java_class_count_to_use_import_on_demand = 999 | ||
|
||
[*.json] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[.editorconfig] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.gradle] | ||
indent_style = tab | ||
|
||
[*.toml] | ||
indent_style = tab | ||
tab_width = 2 | ||
|
||
[*.properties] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,33 @@ | ||
gradlew* linguist-vendored | ||
gradle/wrapper/* linguist-vendored | ||
|
||
*.java text eol=lf diff=java | ||
*.gradle text eol=lf diff=java | ||
*.kt text eol=lf diff=kotlin | ||
*.kts text eol=lf diff=kotlin | ||
gradlew text eol=lf | ||
*.bat text eol=crlf | ||
|
||
*.md text eol=lf diff=markdown | ||
|
||
.editorconfig text eol=lf | ||
|
||
*.json text eol=lf | ||
*.json5 text eol=lf | ||
*.properties text eol=lf | ||
*.toml text eol=lf | ||
*.xml text eol=lf diff=html | ||
|
||
# Modding specific | ||
*.accesswidener text eol=lf | ||
|
||
# These files are binary and should be left untouched | ||
# (binary is a macro for -text -diff) | ||
*.class binary | ||
*.dll binary | ||
*.ear binary | ||
*.jar binary | ||
*.jks binary | ||
*.png binary | ||
*.so binary | ||
*.war binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# %NAME% | ||
|
||
![Build](https://github.com/%REPOSITORY%/workflows/Build/badge.svg) | ||
|
||
## Template TODO list | ||
- [x] Create a new [Forge mod template][template] project. | ||
- [ ] Get familiar with the [legacy modding documentation][docs]. | ||
- [ ] Set the `MOD_ID` in `gradle.properties` | ||
- | ||
--- | ||
Mod based on nea89's [Forge mod template][template]. | ||
|
||
[template]: https://github.com/nea89o/Forge1.8.9Template | ||
[docs]: https://moddev.nea.moe/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Constants | ||
modGroup = %GROUP% | ||
modName = %NAME% | ||
modMCVersion = 1.8.9 | ||
modID = examplemod | ||
modVersion = 1.0.0 | ||
modGitHub = https://github.com/%REPOSITORY% | ||
|
||
# Loom Settings | ||
loom.platform = forge | ||
|
||
# Gradle Settings | ||
org.gradle.jvmargs = -Xmx2g | ||
org.gradle.caching = true | ||
gradleVersion = 8.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
pluginManagement { | ||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
maven("https://oss.sonatype.org/content/repositories/snapshots") | ||
maven("https://maven.architectury.dev/") | ||
maven("https://maven.fabricmc.net") | ||
maven("https://maven.minecraftforge.net/") | ||
maven("https://repo.spongepowered.org/maven/") | ||
maven("https://repo.sk1er.club/repository/maven-releases/") | ||
} | ||
resolutionStrategy { | ||
eachPlugin { | ||
when (requested.id.id) { | ||
"gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}") | ||
} | ||
} | ||
} | ||
} | ||
|
||
plugins { | ||
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0") | ||
} | ||
|
||
|
||
rootProject.name = "%NAME%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Template Cleanup | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
template-cleanup: | ||
name: Template Cleanup | ||
runs-on: ubuntu-latest | ||
if: github.event.repository.name != 'Forge1.8.9Template' | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cleanup | ||
run: | | ||
NAME="${GITHUB_REPOSITORY##*/}" | ||
ACTOR=$(echo $GITHUB_ACTOR | tr '[:upper:]' '[:lower:]') | ||
SAFE_NAME=$(echo $NAME | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') | ||
SAFE_ACTOR=$(echo $ACTOR | sed 's/[^a-zA-Z0-9]//g' | tr '[:upper:]' '[:lower:]') | ||
GROUP="com.github.$SAFE_ACTOR.$SAFE_NAME" | ||
sed -i "s/%NAME%/$NAME/g" .github/template-cleanup/* | ||
sed -i "s/%REPOSITORY%/${GITHUB_REPOSITORY/\//\\/}/g" .github/template-cleanup/* | ||
sed -i "s/%GROUP%/$GROUP/g" .github/template-cleanup/* | ||
find src -type f -exec sed -i "s/org.jetbrains.plugins.template/$GROUP/g" {} + | ||
find src -type f -exec sed -i "s/Example Mod/$NAME/g" {} + | ||
find src -type f -exec sed -i "s/Authors/$ACTOR/g" {} + | ||
mkdir -p src/main/java/${GROUP//.//} | ||
cp -R .github/template-cleanup/. . | ||
cp -R src/main/java/com/example/* src/main/java/${GROUP//.//}/ | ||
rm -rf \ | ||
.github/template-cleanup \ | ||
.github/workflows/template-cleanup.yml \ | ||
.github/workflows/template-verify.yml \ | ||
LICENSE | ||
- name: Commit Files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Template cleanup" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: main | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Template Verify | ||
on: | ||
push: | ||
branches: [main] | ||
paths: ['**/gradle.properties'] | ||
pull_request: | ||
paths: ['**/gradle.properties'] | ||
|
||
jobs: | ||
build: | ||
name: Template Verify | ||
if: github.event.repository.name == 'Forge1.8.9Template' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.properties.outputs.version }} | ||
changelog: ${{ steps.properties.outputs.changelog }} | ||
steps: | ||
- name: Fetch Sources | ||
uses: actions/checkout@v4 | ||
|
||
- name: Verify gradle.properties | ||
run: | | ||
echo "\`\`\`diff" >> $GITHUB_STEP_SUMMARY | ||
diff -U 0 \ | ||
-I '^modVersion' \ | ||
-I '^modGroup' \ | ||
-I '^modName' \ | ||
-I '^modGitHub' \ | ||
--label .github/template-cleanup/gradle.properties \ | ||
--label gradle.properties \ | ||
.github/template-cleanup/gradle.properties gradle.properties \ | ||
>> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.