Skip to content

Commit

Permalink
Fix uploadBackups task
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Nov 14, 2024
1 parent 9a009bc commit 2fed2a9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,8 @@ task uploadBackups {
}

doLast {
def versionString = project.version as String
def ghVersion = "v" + versionString.substring(0, versionString.indexOf("-"))
def backupUrl = "https://api.wurstclient.net/artifact-backups/ChestESP/${ghVersion}"
def shortVersion = version.substring(0, version.indexOf("-"))
def backupUrl = "https://api.wurstclient.net/artifact-backups/ChestESP/${shortVersion}"

def client = new OkHttpClient()
def multipartBuilder = new MultipartBody.Builder()
Expand All @@ -264,15 +263,15 @@ task uploadBackups {
// Add main JAR
def mainJar = remapJar.archiveFile.get().asFile
multipartBuilder.addFormDataPart(
"file",
"files",
mainJar.name,
RequestBody.create(MediaType.parse("application/java-archive"), mainJar)
)

// Add sources JAR
def sourcesJar = remapSourcesJar.archiveFile.get().asFile
multipartBuilder.addFormDataPart(
"file",
"files",
sourcesJar.name,
RequestBody.create(MediaType.parse("application/java-archive"), sourcesJar)
)
Expand Down

0 comments on commit 2fed2a9

Please sign in to comment.