Skip to content

Commit

Permalink
Refactor based on updated mod template
Browse files Browse the repository at this point in the history
  • Loading branch information
OffsetMonkey538 committed Jul 25, 2024
1 parent fb4add7 commit f7ac463
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-read-only: false

- name: Build with Gradle
run: ./gradlew build
Expand All @@ -32,15 +34,11 @@ jobs:
- name: Upload to Modrinth
run: ./gradlew modrinth
env:
DISABLE_PROPERTIES_UPDATE: true
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
VERSION_NAME: ${{ github.event.release.name }}
VERSION_CHANGELOG: ${{ github.event.release.body }}

- name: Upload to GitHub
uses: svenstaro/upload-release-action@v2
uses: softprops/action-gh-release@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: build/libs/*.jar
tag: ${{ github.ref }}
overwrite: true
file_glob: true
files: build/libs/*.jar
28 changes: 17 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ loom {
afterEvaluate {
loom.runs.configureEach {
vmArg "-javaagent:${configurations.compileClasspath.find{ it.name.contains("sponge-mixin") }}"
if (System.getenv("DISABLE_PROPERTIES_UPDATE") == null) vmArg "-Ddevauth.enabled=true"
}
}

Expand All @@ -63,6 +64,13 @@ configurations {
repositories {
mavenCentral()
mavenLocal()
maven {
name = "DevAuth"
url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1"
content {
includeGroup "me.djtheredstoner"
}
}
maven {
name = "OffsetMods538"
url = "https://maven.offsetmonkey538.top/releases"
Expand All @@ -77,6 +85,8 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${devauth_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}"

modImplementation "top.offsetmonkey538.monkeylib538:monkeylib538:${project.monkeylib538_version}"
Expand All @@ -99,18 +109,16 @@ dependencies {
}

processResources {
inputs.properties(Map.of(
final Map properties = Map<String, String>.of(
"modVersion", project.mod_version,
"supportedMinecraftVersions", project.supported_minecraft_versions,
"monkeylib538Version", project.monkeylib538_version
))
)

inputs.properties(properties)

filesMatching("fabric.mod.json") {
expand(Map.of(
"modVersion", project.mod_version,
"supportedMinecraftVersions", project.supported_minecraft_versions,
"monkeylib538Version", project.monkeylib538_version
))
expand(properties)
}

exclude ".cache/**"
Expand Down Expand Up @@ -142,10 +150,8 @@ modrinth {
additionalFiles = [sourcesJar.archiveFile]
gameVersions = outlet.mcVersions()
syncBodyFrom = rootProject.file("README.md").text
def changelogFile = rootProject.file("CHANGELOG.md")
if (changelogFile.exists()) {
changelog = changelogFile.text
}
def changelogEnv = System.getenv("VERSION_CHANGELOG")
if (changelogEnv != null) changelog = changelogEnv

dependencies {
required.project "monkeylib538"
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ loader_version = 0.16.0
fapi_version = 0.100.7+1.21

# Dependencies
## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth
devauth_version = 1.2.1

monkeylib538_version = 2.0.1+1.21

jgit_version = 6.9.0.202403050737-r
Expand Down

0 comments on commit f7ac463

Please sign in to comment.