Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

Remove useless sha256 files in Github release

ldm0fadbbe13f90f
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 843aaafb0..2f6a7b8d2 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -231,23 +231,15 @@ jobs:
)
for archive in "${expected_archives[@]}"; do
test -f "dist/$archive"
- test -f "dist/$archive.sha256"
done
artifact_count=$(find dist -maxdepth 1 -type f | wc -l)
- if [[ "$artifact_count" -ne 8 ]]; then
- echo "Expected 8 release assets, found $artifact_count." >&2
+ if [[ "$artifact_count" -ne 4 ]]; then
+ echo "Expected 4 release assets, found $artifact_count." >&2
find dist -maxdepth 1 -type f -print >&2
exit 1
fi
- (
- cd dist
- for checksum in *.sha256; do
- sha256sum --check "$checksum"
- done
- )
-
- name: Create GitHub Release
shell: bash
env:
@@ -261,13 +253,9 @@ jobs:
assets=(
"dist/moli-v${RELEASE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
- "dist/moli-v${RELEASE_VERSION}-x86_64-unknown-linux-gnu.tar.gz.sha256"
"dist/moli-v${RELEASE_VERSION}-x86_64-apple-darwin.tar.gz"
- "dist/moli-v${RELEASE_VERSION}-x86_64-apple-darwin.tar.gz.sha256"
"dist/moli-v${RELEASE_VERSION}-aarch64-apple-darwin.tar.gz"
- "dist/moli-v${RELEASE_VERSION}-aarch64-apple-darwin.tar.gz.sha256"
"dist/moli-v${RELEASE_VERSION}-x86_64-pc-windows-msvc.zip"
- "dist/moli-v${RELEASE_VERSION}-x86_64-pc-windows-msvc.zip.sha256"
)
args=(
release create "$RELEASE_TAG"
diff --git a/RELEASING.md b/RELEASING.md
index 580c45735..fafed84a2 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -10,8 +10,8 @@ The release workflow builds and publishes four native archives:
| Windows x86_64 | `x86_64-pc-windows-msvc` | `.zip` |
Every archive contains the `moli` executable, project licenses, README,
-version marker, and third-party license notices. A SHA-256 checksum is
-published beside each archive.
+version marker, and third-party license notices. GitHub displays the SHA-256
+digest for each uploaded release asset.
Each artifact is built on its native GitHub-hosted runner. The packager strips
only a staging copy, leaving the binary under `target/release` unchanged for
@@ -52,7 +52,7 @@ untested.
4. Choose whether the release should be a prerelease or a draft, then run it.
The workflow validates the selected commit, builds all four native artifacts
-in parallel, verifies every checksum, creates the corresponding `vX.Y.Z` tag,
-generates release notes, and uploads all archives and checksums. It stops
-without creating a release if any platform fails, if the requested version
-does not match the manifest, or if the tag already exists.
+in parallel, verifies the expected archives, creates the corresponding
+`vX.Y.Z` tag, generates release notes, and uploads all four archives. It stops
+without creating a release if any platform fails, if the requested version does
+not match the manifest, or if the tag already exists.
diff --git a/scripts/release.py b/scripts/release.py
index 29d002b34..2683daaaa 100755
--- a/scripts/release.py
+++ b/scripts/release.py
@@ -4,7 +4,6 @@
from __future__ import annotations
import argparse
-import hashlib
import os
import re
import shlex
@@ -229,26 +228,16 @@ def verify_archive(archive_path: Path, expected_binary: str, target: str) -> Non
)
-def sha256(path: Path) -> str:
- digest = hashlib.sha256()
- with path.open("rb") as input_file:
- for chunk in iter(lambda: input_file.read(1024 * 1024), b""):
- digest.update(chunk)
- return digest.hexdigest()
-
-
def package_release(
*, version: str, target: str, binary: Path, output_dir: Path
-) -> tuple[Path, Path, int, int]:
+) -> tuple[Path, int, int]:
package_name = f"moli-v{version}-{target}"
extension = ".zip" if "-windows-" in target else ".tar.gz"
archive_path = output_dir / f"{package_name}{extension}"
- checksum_path = output_dir / f"{archive_path.name}.sha256"
output_dir.mkdir(parents=True, exist_ok=True)
- for output in (archive_path, checksum_path):
- if output.exists():
- raise ReleaseError(f"release output already exists: {output}")
+ if archive_path.exists():
+ raise ReleaseError(f"release output already exists: {archive_path}")
with tempfile.TemporaryDirectory(prefix=".moli-release-", dir=output_dir) as raw:
staging_dir = Path(raw)
@@ -280,18 +269,9 @@ def package_release(
target,
)
- digest = sha256(staged_archive)
- staged_checksum = staging_dir / checksum_path.name
- staged_checksum.write_text(
- f"{digest} {archive_path.name}\n", encoding="ascii"
- )
- if sha256(staged_archive) != digest:
- raise ReleaseError("archive checksum changed during packaging")
-
staged_archive.rename(archive_path)
- staged_checksum.rename(checksum_path)
- return archive_path, checksum_path, original_size, stripped_size
+ return archive_path, original_size, stripped_size
def parse_args() -> argparse.Namespace:
@@ -352,7 +332,7 @@ def main() -> int:
raise ReleaseError(f"release binary not found: {binary}")
output_dir = resolve_repo_path(args.output_dir)
- archive, checksum, before, after = package_release(
+ archive, before, after = package_release(
version=version,
target=target,
binary=binary,
@@ -362,7 +342,6 @@ def main() -> int:
print(f"Packaged target: {target}")
print(f"Staged binary: {before:,} -> {after:,} bytes after strip")
print(f"Created: {archive}")
- print(f"Created: {checksum}")
return 0
except ReleaseError as error:
print(f"release error: {error}", file=sys.stderr)