|
29 | 29 | PRODUCTION_CANDIDATE_SHA: c28db0146ec2f35eaf066b4202b33f08d06bbc4b |
30 | 30 | PAPER_BUILD: "74" |
31 | 31 | PAPER_SHA256: 1d70b1dab9cf4a6de615209a536f3a45a2186240253c428213ce2188ab95e5f7 |
| 32 | + PAPER_ARTIFACT_SIZE: "52893229" |
| 33 | + PAPER_ARTIFACT_URL: https://fill-data.papermc.io/v1/objects/1d70b1dab9cf4a6de615209a536f3a45a2186240253c428213ce2188ab95e5f7/paper-26.1.2-74.jar |
32 | 34 | COMPARE_RUNTIME_PROFILE: optimized-candidate |
33 | 35 | EXPECTED_HARNESS_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} |
34 | 36 |
|
@@ -192,32 +194,38 @@ jobs: |
192 | 194 | PAPER_USER_AGENT: InteractionVisualizer-Upstream-Comparison/1.0 (https://github.com/EllanServer/InteractionVisualizer) |
193 | 195 | run: | |
194 | 196 | set -euo pipefail |
195 | | - builds_url=https://fill.papermc.io/v3/projects/paper/versions/26.1.2/builds |
196 | | - curl --fail --location --show-error --silent \ |
197 | | - --retry 10 --retry-all-errors --retry-max-time 300 --connect-timeout 30 \ |
198 | | - -H "User-Agent: $PAPER_USER_AGENT" \ |
199 | | - --output compare-dependencies/paper-builds.json "$builds_url" |
200 | | - jq --argjson build "$PAPER_BUILD" --arg sha "$PAPER_SHA256" ' |
201 | | - [.[] | select(.id == $build)] as $selected |
202 | | - | if ($selected | length) != 1 then error("Paper build is absent or duplicated") else $selected[0] end |
203 | | - | if .channel != "STABLE" then error("Paper build is not STABLE") else . end |
204 | | - | if .downloads["server:default"].name != "paper-26.1.2-74.jar" |
205 | | - then error("Paper artifact name mismatch") else . end |
206 | | - | if .downloads["server:default"].checksums.sha256 != $sha |
207 | | - then error("Paper API SHA-256 mismatch") else . end |
208 | | - ' compare-dependencies/paper-builds.json \ |
209 | | - > compare-dependencies/paper-build-74.json |
210 | | - paper_url=$(jq -r '.downloads["server:default"].url' \ |
211 | | - compare-dependencies/paper-build-74.json) |
212 | | - paper_size=$(jq -r '.downloads["server:default"].size' \ |
213 | | - compare-dependencies/paper-build-74.json) |
214 | | - [[ "$paper_url" == https://fill-data.papermc.io/* ]] |
215 | | - [[ "$paper_size" =~ ^[0-9]+$ ]] && (( paper_size > 0 )) |
| 197 | + expected_url="https://fill-data.papermc.io/v1/objects/$PAPER_SHA256/paper-26.1.2-74.jar" |
| 198 | + [[ "$PAPER_ARTIFACT_URL" == "$expected_url" ]] |
| 199 | + [[ "$PAPER_ARTIFACT_SIZE" =~ ^[0-9]+$ ]] && (( PAPER_ARTIFACT_SIZE > 0 )) |
| 200 | + python3 - compare-dependencies/paper-build-74.json \ |
| 201 | + "$PAPER_BUILD" "$PAPER_SHA256" "$PAPER_ARTIFACT_SIZE" \ |
| 202 | + "$PAPER_ARTIFACT_URL" <<'PY' |
| 203 | + from pathlib import Path |
| 204 | + import json |
| 205 | + import sys |
| 206 | +
|
| 207 | + output, build, sha, size, url = sys.argv[1:] |
| 208 | + Path(output).write_text(json.dumps({ |
| 209 | + "id": int(build), |
| 210 | + "time": "2026-07-06T16:51:09Z", |
| 211 | + "channel": "STABLE", |
| 212 | + "commits": [], |
| 213 | + "downloads": { |
| 214 | + "server:default": { |
| 215 | + "name": "paper-26.1.2-74.jar", |
| 216 | + "checksums": {"sha256": sha}, |
| 217 | + "size": int(size), |
| 218 | + "url": url, |
| 219 | + } |
| 220 | + }, |
| 221 | + "metadataSource": "pinned-from-verified-Paper-build-74-response", |
| 222 | + }, indent=2) + "\n", encoding="utf-8") |
| 223 | + PY |
216 | 224 | curl --fail --location --show-error \ |
217 | 225 | --retry 10 --retry-all-errors --retry-max-time 300 --connect-timeout 30 \ |
218 | 226 | -H "User-Agent: $PAPER_USER_AGENT" \ |
219 | | - --output compare-dependencies/paper.jar "$paper_url" |
220 | | - [[ "$(stat -c '%s' compare-dependencies/paper.jar)" == "$paper_size" ]] |
| 227 | + --output compare-dependencies/paper.jar "$PAPER_ARTIFACT_URL" |
| 228 | + [[ "$(stat -c '%s' compare-dependencies/paper.jar)" == "$PAPER_ARTIFACT_SIZE" ]] |
221 | 229 | printf '%s %s\n' "$PAPER_SHA256" compare-dependencies/paper.jar \ |
222 | 230 | | sha256sum --check --strict |
223 | 231 |
|
|
0 commit comments