Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ jobs:
binary=proofline
if [[ "$TARGET" == *windows* ]]; then binary=proofline.exe; fi
test "$(target/"$TARGET"/release/"$binary" --version)" = "proofline $VERSION"
if [[ "$TARGET" == x86_64-unknown-linux-musl && -f install.sh ]]; then
sh -n install.sh
grep -Fxq "PROOFLINE_INSTALLER_VERSION=$VERSION" install.sh
if grep -q '^PROOFLINE_SETUP_MIN_VERSION=' install.sh; then
minimum=$(sed -n 's/^PROOFLINE_SETUP_MIN_VERSION=//p' install.sh)
[[ "$minimum" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
[[ "$(printf '%s\n%s\n' "$minimum" "$VERSION" | sort -V | tail -1)" == "$VERSION" ]]
"target/$TARGET/release/proofline" agent install claude-code --print > /dev/null
fi
fi
python3 scripts/archive.py "$TARGET"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
Expand Down Expand Up @@ -104,6 +114,7 @@ jobs:
test "$(find artifacts -name '*.tar.gz' | wc -l)" -eq 5
(cd artifacts && LC_ALL=C sha256sum proofline-*.tar.gz > SHA256SUMS)
printf '%s\n' "$VERSION" > artifacts/latest
if [[ -f install.sh ]]; then cp install.sh artifacts/install.sh; fi
python3 scripts/github-assets.py "$VERSION" artifacts
- uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
with:
Expand Down
3 changes: 3 additions & 0 deletions scripts/publish-r2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ for target in $targets; do
immutable "$version/$archive" "$dist/$archive" application/gzip
done
immutable "$version/SHA256SUMS" "$dist/SHA256SUMS" 'text/plain; charset=utf-8'
if [ -f "$dist/install.sh" ]; then
immutable "$version/install.sh" "$dist/install.sh" 'text/plain; charset=utf-8'
fi
if [ "$latest" != "$version" ]; then
printf '%s\n' "$version" > "$temporary/latest"
put latest "$temporary/latest" 'text/plain; charset=utf-8' 'public, max-age=60' "$condition"
Expand Down
15 changes: 15 additions & 0 deletions scripts/test_publish_r2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ def test_upload_refusal_keeps_latest_absent(self):
self.assertNotEqual(self.run_publish().returncode, 0)
self.assertEqual(self.requests, [])

def test_installer_failure_preserves_latest_and_retry_finishes_the_release(self):
installer = b"#!/bin/sh\nexit 0\n"
(self.dist / "install.sh").write_bytes(installer)
key = "/proofline-cli-releases/0.1.0/install.sh"
type(self).reject = key
self.assertNotEqual(self.run_publish().returncode, 0)
self.assertNotIn("/proofline-cli-releases/latest", self.objects)
self.requests.clear()
type(self).reject = None
result = self.run_publish()
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual([(path, body) for path, _, body in self.requests], [
(key, installer), ("/proofline-cli-releases/latest", b"0.1.0\n"),
])

def test_checksum_mismatch_writes_nothing(self):
(self.dist / f"proofline-{TARGETS[-1]}.tar.gz").write_bytes(b"damaged")
self.assertNotEqual(self.run_publish().returncode, 0)
Expand Down
Loading