Skip to content

Commit

Permalink
eggolib 1.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eggohito committed Feb 13, 2024
1 parent cb326c4 commit e5efe05
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 203 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish
run-name: Publish ${{ github.ref }} to Modrinth and CurseForge

on: release

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: Kir-Antipov/[email protected]
with:
java: 17

modrinth-id: uFJODQCA
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: false

curseforge-id: 645296
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
73 changes: 0 additions & 73 deletions .github/workflows/release.yml

This file was deleted.

113 changes: 0 additions & 113 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
plugins {
id 'com.github.breadmoirai.github-release' version '2.4.1'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.10.0'
id 'com.modrinth.minotaur' version'2.+'
id 'maven-publish'
}

Expand Down Expand Up @@ -174,112 +170,3 @@ publishing {
// retrieving dependencies.
}
}

curseforge {

var token = System.getenv("CURSEFORGE_TOKEN")

if (token == null || token.isEmpty()) {
System.err.println("Cannot publish to CurseForge: missing token!")
return
}

var compatibleMinecraftVersions = compatible_minecraft_versions.split(", ")
var minecraftVersionRange = compatibleMinecraftVersions.length > 1
? "(${compatibleMinecraftVersions.first()} - ${compatibleMinecraftVersions.last()})"
: "(${compatibleMinecraftVersions.first()})"

setApiKey(token)
project {

setId(curseforge_id)
setReleaseType('release')

setChangelog(new File("${rootDir}/CHANGELOG.md").getText('UTF-8'))
setChangelogType('markdown')

compatibleMinecraftVersions.each { String minecraftVersion -> addGameVersion(minecraftVersion) }
compatible_java_versions.split(", ").each {String javaVersion -> addGameVersion("Java " + javaVersion) }
compatible_mod_loaders.split(", ").each { String modLoader -> addGameVersion(modLoader) }

mainArtifact(remapJar) {
setDisplayName("${mod_name} v${mod_version} ${minecraftVersionRange}")
relations {
required_dependencies.split(", ").each { String project -> requiredDependency(project) }
optional_dependencies.split(", ").each { String project -> optionalDependency(project) }
}
}

addArtifact(remapSourcesJar) {
setDisplayName("${mod_name} v${mod_version} ${minecraftVersionRange} [Sources]")
}

}

}

modrinth {

var token = System.getenv("MODRINTH_TOKEN")

if (token == null || token.isEmpty()) {
System.err.println("Cannot publish to Modrinth: missing token!")
return
}

var compatibleMinecraftVersions = compatible_minecraft_versions.split(", ")
var minecraftVersionRange = compatibleMinecraftVersions.length > 1
? "(${compatibleMinecraftVersions.first()} - ${compatibleMinecraftVersions.last()})"
: "(${compatibleMinecraftVersions.first()})"

setToken(token)
setProjectId(modrinth_id)

setVersionName("${mod_name} v${mod_version} ${minecraftVersionRange}")
setVersionNumber("v${mod_version}-${System.getenv("GITHUB_COMMITISH")}")
setVersionType("release")

setUploadFile(remapJar)
additionalFiles.add(remapSourcesJar)

setChangelog(new File("${getRootDir()}/CHANGELOG.md").getText('UTF-8'))

compatibleMinecraftVersions.each { String minecraftVersion -> gameVersions.add(minecraftVersion) }
compatible_mod_loaders.split(", ").each { String modLoader -> loaders.add(modLoader) }

dependencies {
required_dependencies.split(", ").each { String project -> required.project(project) }
optional_dependencies.split(", ").each { String project -> optional.project(project) }
}

}

githubRelease {

var token = System.getenv("GITHUB_TOKEN")

if (token == null || token.isEmpty()) {
System.err.println("Cannot publish to GitHub: missing token!")
return
}

var compatibleMinecraftVersions = compatible_minecraft_versions.split(", ")
var minecraftVersionRange = compatibleMinecraftVersions.length > 1
? "(${compatibleMinecraftVersions.first()} - ${compatibleMinecraftVersions.last()})"
: "(${compatibleMinecraftVersions.first()})"

setToken(token)

setOwner(System.getenv("GITHUB_REPO_OWNER"))
setRepo(System.getenv("GITHUB_REPO"))

var commitish = System.getenv("GITHUB_COMMITISH")
setTagName("v${mod_version}-${commitish}")
setTargetCommitish(commitish)

setReleaseName("${mod_name} v${mod_version} ${minecraftVersionRange}")
releaseAssets(remapJar, remapSourcesJar)

setBody(new File("${getRootDir()}/CHANGELOG.md").getText('UTF-8'))

}
15 changes: 1 addition & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ org.gradle.jvmargs = -Xmx4G

# Mod Properties
mod_name = eggolib
mod_version = 1.10.1
mod_version = 1.10.2
maven_group = com.github.eggohito
archives_base_name = eggolib-1.20.2

Expand All @@ -20,16 +20,3 @@ org.gradle.jvmargs = -Xmx4G
reach_version = 2.4.0
breathing_lib_version = 01269c3
mod_menu_version = 8.0.1

# CurseForge metadata
curseforge_id = 645296

# Modrinth metadata
modrinth_id = uFJODQCA

# Publishing metadata
compatible_mod_loaders = fabric
compatible_java_versions = 17
compatible_minecraft_versions = 1.20.2
required_dependencies = fabric-api
optional_dependencies = origins
9 changes: 6 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@
}
},
"depends": {
"fabricloader": ">=0.15.6",
"fabric": ">=0.91.6",
"minecraft": ">=1.20.2",
"fabricloader": "~0.15.6",
"fabric": "~0.91.6",
"minecraft": "1.20.2",
"java": ">=17"
},
"suggests": {
"origins": "*"
},
"accessWidener": "eggolib.accesswidener"
}

0 comments on commit e5efe05

Please sign in to comment.