Skip to content

Commit

Permalink
Migrate release action to Kir-Antipov/mc-publish
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
PotatoPresident committed Jan 12, 2024
1 parent a85a1e2 commit ebea48b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@ jobs:
env:
CURSEFORGE_TOKEN: ${{ secrets.CF_API_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CHANGELOG: ${{ github.event.body }}
run: ./gradlew release

- name: Upload GitHub release
uses: AButler/upload-release-assets@v2.0
- name: Upload assets to GitHub, Modrinth and CurseForge
uses: Kir-Antipov/mc-publish@v3.2
with:
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev-all.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
modrinth-id: LVN9ygNV
modrinth-featured: false
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

curseforge-id: 491137
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

github-token: ${{ secrets.GITHUB_TOKEN }}

loaders: |
fabric
quilt
19 changes: 7 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import com.modrinth.minotaur.TaskModrinthUpload

plugins {
kotlin("jvm") version "1.7.10"
id("fabric-loom") version "1.4.+"
id("maven-publish")
id("io.gitlab.arturbosch.detekt") version "1.19.0"
id("com.github.jakemarsden.git-hooks") version "0.0.2"
id("com.modrinth.minotaur") version "2.+"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("com.matthewprenger.cursegradle") version "1.4.0"
}

var release = false
val props = properties

val modId: String by project
Expand Down Expand Up @@ -107,6 +102,7 @@ tasks {
"name" to modName,
"fabricApi" to libs.versions.fabric.api.get(),
"fabricKotlin" to libs.versions.fabric.kotlin.get(),
"minecraft" to libs.versions.minecraft.get(),
)
)
}
Expand Down Expand Up @@ -178,10 +174,6 @@ tasks {
jvmTarget = javaVersion.toString()
}
}

withType<TaskModrinthUpload> {
onlyIf { System.getenv().contains("MODRINTH_TOKEN") }
}
}

// configure the maven publication
Expand Down Expand Up @@ -211,15 +203,18 @@ gitHooks {
}

fun getVersionMetadata(): String {
if (release) return ""

val buildId = System.getenv("GITHUB_RUN_NUMBER")
val workflow = System.getenv("GITHUB_WORKFLOW")

if (workflow == "Release") {
return ""
}

// CI builds only
if (buildId != null) {
return "+build.$buildId"
}

// No tracking information could be found about the build
return ""
return "+local"
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx1G

# Mod Properties
modVersion = 1.2.9
modVersion = 1.2.10
mavenGroup = com.github.quiltservertools
modId = ledger
modName = Ledger
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"fabricloader": ">=0.15.0",
"fabric": ">=${fabricApi}",
"fabric-language-kotlin": ">=${fabricKotlin}",
"minecraft": ">=1.20.2"
"minecraft": ">=${minecraft}"
},
"breaks": {
"cardboard": "*"
Expand Down

0 comments on commit ebea48b

Please sign in to comment.