From f0ab291a26b8bd063ce06ae15da51e98e41aed15 Mon Sep 17 00:00:00 2001 From: Francesc Date: Thu, 12 Nov 2026 08:47:25 +0100 Subject: [PATCH] fix: a release names its files the way GitHub will leave them The first beta went out with a .deb called gitrust_0.1.0~beta.1 and GitHub published it as gitrust_0.1.0.beta.1: it does not keep a tilde in the name of a release file, and does not say so. SHA256SUMS had been written before that and went on naming the file by the name it no longer had, so checking the download against it failed on the .deb -- which was the right file all along. The .deb now leaves the Linux job named after the version as Cargo writes it, hyphen and all. The version inside the package keeps its tilde, and that is the one dpkg reads. And the publish job stops, before anything is published, on any file whose name GitHub might change, so the next character it objects to is found by a red run and not by somebody checking a download. Signed-off-by: Francesc Co-Authored-By: Claude --- .github/workflows/release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b460f53..88bd9d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,18 @@ jobs: tar -czf "$out.tar.gz" "$out" mkdir -p out - mv "$out.tar.gz" target/gitrust_*.deb out/ + mv "$out.tar.gz" out/ + + # The .deb goes out under the version as Cargo writes it, hyphen + # and all, and not under the one inside it. dpkg wants a tilde in + # the version of a beta and GitHub will not have one in the name + # of a release file: gitrust_0.1.0~beta.1_amd64.deb was published + # as gitrust_0.1.0.beta.1_amd64.deb without a word, and the + # SHA256SUMS beside it went on naming a file that was not there. + # What dpkg reads is the version inside the package, and that is + # not touched here. + deb=$(ls target/gitrust_*.deb) + mv "$deb" "out/gitrust_${version}_${deb##*_}" - uses: actions/upload-artifact@v4 with: @@ -216,10 +227,21 @@ jobs: with: path: files + # GitHub renames a release file whose name it does not like, quietly, + # and the checksums are written before it gets the chance -- so they + # would name a file that is no longer called that. A name it might + # change stops the release here, while nothing has been published. - name: Gather run: | mkdir -p out find files -type f -exec mv {} out/ \; + for file in out/*; do + name=${file##*/} + if [[ ! $name =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then + echo "GitHub would rename $name, and SHA256SUMS would not" + exit 1 + fi + done ( cd out && sha256sum * > SHA256SUMS ) ls -l out