Skip to content

Commit 23fbc79

Browse files
committed
change the actual version inside the jar to reflect the dev builds
1 parent f42db08 commit 23fbc79

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/dev-build.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ jobs:
4141
-PmavenUsername=${{ secrets.MAVEN_USER }} \
4242
-PmavenPassword=${{ secrets.MAVEN_TOKEN }}
4343
44-
- name: Rename jar
45-
run: mv build/libs/${{ steps.all.outputs.modId }}-${{ steps.all.outputs.modVersion }}.jar build/libs/${{ steps.all.outputs.modId }}-${{ steps.all.outputs.modVersion }}-dev.${{ github.run_number }}.jar
46-
4744
- name: Upload build artifacts
4845
uses: actions/upload-artifact@v4
4946
with:

build.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ plugins {
1919
id("maven-publish")
2020
}
2121

22-
version = project.property("modVersion") as String
22+
val isDevBuild = project.hasProperty("mavenType") && project.property("mavenType") == "dev"
23+
val buildNum = if (project.hasProperty("buildNumber")) project.property("buildNumber") as String else null
24+
25+
version = if (isDevBuild && buildNum != null) {
26+
"${project.property("modVersion")}-dev.$buildNum"
27+
} else {
28+
project.property("modVersion") as String
29+
}
2330
group = project.property("mavenGroup") as String
2431
base.archivesName = modId
2532

0 commit comments

Comments
 (0)