Skip to content

Commit

Permalink
Add unified publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxNeedsSnacks committed Sep 25, 2023
1 parent d71e185 commit 569c5d9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_1902.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Build and Publish with Gradle
uses: gradle/gradle-build-action@v2
env:
FTB_MAVEN_TOKEN: ${{ secrets.FTB_MAVEN_TOKEN }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
SAPS_TOKEN: ${{ secrets.SAPS_TOKEN }}
with:
arguments: build publish --stacktrace --no-daemon
Expand All @@ -58,6 +58,7 @@ jobs:
GIT_COMMIT: ${{ github.event.after }}
GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
CURSEFORGE_KEY: ${{ secrets.CURSEFORGE_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
RELEASE_TYPE: ${{ inputs.release_type }}
with:
arguments: curseforge --stacktrace --no-daemon
arguments: publishUnified --stacktrace --no-daemon
57 changes: 43 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
id "io.github.juuxel.loom-vineflower" version "1.11.0"
id 'maven-publish'
id "me.shedaniel.unified-publishing" version "0.1.+"
}

apply from: 'https://files.latmod.com/public/markdown-git-changelog.gradle'
Expand Down Expand Up @@ -125,24 +126,52 @@ publishing {
}
}
}

if (ENV.MAVEN_TOKEN) {
maven {
url "https://maven.latvian.dev/releases"
credentials {
username = "lat"
password = "${ENV.MAVEN_TOKEN}"
}
}
}
}
}

if (ENV.CURSEFORGE_KEY) {
curseforge {
apiKey = ENV.CURSEFORGE_KEY
project {
id = project.curseforge_id
releaseType = project.curseforge_type
addGameVersion "Forge"
addGameVersion "1.19.2"
mainArtifact(remapJar.archivePath)
relations {
requiredDependency 'kubejs'
requiredDependency 'mekanism'
unifiedPublishing {
project {
releaseType = "${ENV.RELEASE_TYPE ?: 'release'}"
gameVersions = [
rootProject.minecraft_version
]
gameLoaders = ["forge"]
displayName = "$mod_name Forge $project.version"
changelog = getGitChangelog()
mainPublication remapJar

relations {
depends {
curseforge = modrinth = "kubejs"
}
depends {
curseforge = modrinth = "mekanism"
}
}

if (ENV.CURSEFORGE_KEY) {
curseforge {
token = ENV.CURSEFORGE_KEY
id = project.curseforge_id
}
}

if (ENV.MODRINTH_TOKEN) {
modrinth {
token = ENV.MODRINTH_TOKEN
id = project.modrinth_id
version = "$project.version+$project.name"
}
changelog = getGitChangelog
changelogType = 'markdown'
}
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
loom.platform=forge
mod_id=kubejs_mekanism
mod_name=KubeJS Mekanism
archives_base_name=kubejs-mekanism
mod_version=1902.1.5
maven_group=dev.latvian.mods
mod_author=LatvianModder
minecraft_version=1.19.2
forge_version=43.2.8
curseforge_id=418651
curseforge_type=release
modrinth_id=sY2Fy24K
jei_file=4615177
kubejs_version=1902.6.1-build.300
mekanism_version=1.19.2-10.3.9.13

0 comments on commit 569c5d9

Please sign in to comment.