Skip to content

Commit ae20618

Browse files
authored
fix: consolidate per-platform SHA512SUMS into single file to avoid upload collisions (#120)
Each build artifact previously included a SHA512SUMS file with identical filenames across platforms, causing 'asset under the same name already exists' errors during release upload. Now all per-platform SHA512SUMS files are merged into a single combined SHA512SUMS at the workspace root before upload, matching common open-source conventions (e.g. Node.js SHASUMS256.txt). Per-artifact copies are deleted so they are not uploaded redundantly.
1 parent 82850e1 commit ae20618

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ jobs:
203203
done
204204
}
205205
206+
# Combine all per-artifact SHA512SUMS into a single file at the workspace root.
207+
# This mirrors the common open-source convention (e.g. Node.js SHASUMS256.txt)
208+
# and avoids GitHub Release asset name collisions.
209+
combined_sha="SHA512SUMS"
210+
find clang-tools-* -name SHA512SUMS -type f -print0 | xargs -0 cat > "$combined_sha"
211+
echo "Created combined $(wc -l < "$combined_sha")-entry $combined_sha"
212+
213+
# Remove the per-artifact SHA512SUMS files so they are not uploaded individually.
214+
find clang-tools-* -name SHA512SUMS -type f -delete
215+
206216
# Collect all files and upload one-by-one with a small delay
207-
mapfile -t files < <(find clang-* -type f)
217+
mapfile -t files < <(find clang-tools-* -type f)
208218
209219
if [[ ${#files[@]} -eq 0 ]]; then
210220
echo "::warning::No files found to upload"
@@ -213,8 +223,9 @@ jobs:
213223
214224
echo "Found ${#files[@]} files to upload"
215225
failed=0
216-
# Upload versions.json
226+
# Upload top-level metadata files first (no filename conflicts)
217227
upload_with_retry "versions.json" || failed=1
228+
upload_with_retry "SHA512SUMS" || failed=1
218229
for file in "${files[@]}"; do
219230
upload_with_retry "$file" || failed=1
220231
sleep 1

0 commit comments

Comments
 (0)