Skip to content

Commit 808e69f

Browse files
committed
Merge remote-tracking branch 'upstream/1.21.8' into 1.21.8
2 parents 9481138 + 9624894 commit 808e69f

File tree

2 files changed

+15
-69
lines changed

2 files changed

+15
-69
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,26 +82,29 @@ jobs:
8282
GITHUB_TOKEN: ${{ github.token }}
8383
run: ./gradlew closeMilestone --stacktrace --no-configuration-cache
8484

85+
- name: Build website update inputs
86+
id: website_inputs
87+
if: ${{ inputs.update_website }}
88+
run: |
89+
echo "wurst_version=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/^v//' | sed 's/-MC.*$//')" >> "$GITHUB_OUTPUT"
90+
echo "mc_version=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')" >> "$GITHUB_OUTPUT"
91+
echo "fapi_version=$(grep '^fabric_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')" >> "$GITHUB_OUTPUT"
92+
8593
- name: Upload backups
8694
if: ${{ inputs.upload_backups }}
87-
env:
88-
WI_BACKUPS_API_KEY: ${{ secrets.WI_BACKUPS_API_KEY }}
89-
run: ./gradlew uploadBackups --stacktrace --no-configuration-cache
95+
uses: Wurst-Imperium/upload-backups@v1
96+
with:
97+
api_key: ${{ secrets.WI_BACKUPS_API_KEY }}
98+
project: Wurst
99+
version: ${{ steps.website_inputs.outputs.wurst_version }}
100+
path: build/libs/*.jar
90101

91102
- name: Publish to GitHub
92103
if: ${{ inputs.publish_github }}
93104
env:
94105
GITHUB_TOKEN: ${{ secrets.OLD_MCX_PUBLISH_TOKEN }}
95106
run: ./gradlew github --stacktrace --no-configuration-cache
96107

97-
- name: Build website update inputs
98-
id: website_inputs
99-
if: ${{ inputs.update_website }}
100-
run: |
101-
echo "wurst_version=$(grep '^mod_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/^v//' | sed 's/-MC.*$//')" >> "$GITHUB_OUTPUT"
102-
echo "mc_version=$(grep '^minecraft_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')" >> "$GITHUB_OUTPUT"
103-
echo "fapi_version=$(grep '^fabric_version=' gradle.properties | cut -d'=' -f2 | tr -d ' \r')" >> "$GITHUB_OUTPUT"
104-
105108
- name: Trigger website update
106109
if: ${{ inputs.update_website }}
107110
uses: Wurst-Imperium/dispatch-and-wait@v1

build.gradle

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66

77
plugins {
88
id "fabric-loom" version "${loom_version}"
9-
id "com.diffplug.spotless" version "8.0.0"
9+
id "com.diffplug.spotless" version "8.1.0"
1010
}
1111

1212
def ENV = System.getenv()
@@ -339,60 +339,3 @@ task closeMilestone {
339339
}
340340
}
341341
}
342-
343-
task uploadBackups {
344-
dependsOn build
345-
346-
onlyIf {
347-
ENV.WI_BACKUPS_API_KEY
348-
}
349-
350-
doLast {
351-
def shortVersion = getGhVersion().substring(1)
352-
def backupUrl = "https://api.wurstclient.net/artifact-backups/Wurst/${shortVersion}"
353-
354-
def maxRetries = 3
355-
def retryCount = 0
356-
def success = false
357-
358-
while (!success && retryCount < maxRetries) {
359-
try {
360-
def connection = new URL(backupUrl).openConnection() as HttpURLConnection
361-
def boundary = UUID.randomUUID().toString()
362-
connection.setRequestMethod("POST")
363-
connection.setRequestProperty("X-API-Key", ENV.WI_BACKUPS_API_KEY)
364-
connection.setRequestProperty("Accept", "application/json")
365-
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=$boundary")
366-
connection.doOutput = true
367-
368-
def output = connection.outputStream
369-
[remapJar, remapSourcesJar].each { jarTask ->
370-
def file = jarTask.archiveFile.get().asFile
371-
output << "--${boundary}\r\n"
372-
output << "Content-Disposition: form-data; name=\"files\"; filename=\"${file.name}\"\r\n"
373-
output << "Content-Type: application/java-archive\r\n\r\n"
374-
file.withInputStream { input ->
375-
output << input
376-
}
377-
output << "\r\n"
378-
}
379-
output << "--${boundary}--\r\n"
380-
output.flush()
381-
382-
if(connection.responseCode != 200) {
383-
throw new IOException("HTTP ${connection.responseCode}: ${connection.responseMessage}")
384-
}
385-
386-
success = true
387-
388-
} catch (Exception e) {
389-
retryCount++
390-
if (retryCount >= maxRetries) {
391-
throw new GradleException("Failed to upload backups after ${maxRetries} attempts: ${e.message}")
392-
}
393-
println "Upload attempt ${retryCount} failed: ${e.message}. Retrying in 5 seconds..."
394-
Thread.sleep(5000)
395-
}
396-
}
397-
}
398-
}

0 commit comments

Comments
 (0)