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 86840f5 commit 683f06f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .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
57 changes: 43 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "dev.architectury.loom" version "1.2-SNAPSHOT"
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "me.shedaniel.unified-publishing" version "0.1.+"
}

apply from: 'https://files.latmod.com/public/markdown-git-changelog.gradle'
Expand Down Expand Up @@ -135,24 +136,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 'thermal-expansion'
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 = "thermal-expansion"
}
}

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'
}
}
}

0 comments on commit 683f06f

Please sign in to comment.