File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -252,20 +252,15 @@ jobs:
252252 archive="MasterHttpRelayVPN-${version}-termux-${arch}.zip"
253253 (cd "$staging" && zip -qr "../release-assets/${archive}" .)
254254
255- # Generate checksum with environment variable
256- export ARCHIVE_NAME="$archive"
257- python3 - << 'PYTHON'
255+ # Generate checksum
256+ python3 << EOF
258257import hashlib
259258from pathlib import Path
260- import os
261- archive_name = os.environ.get("ARCHIVE_NAME", "")
262- archive = Path("release-assets") / archive_name
263- digest = hashlib.sha256(archive.read_bytes()).hexdigest()
264- (archive.parent / f"{archive.name}.sha256").write_text(
265- f"{digest} {archive.name}\n",
266- encoding="utf-8",
267- )
268- PYTHON
259+ archive_file = Path("release-assets") / "$archive"
260+ sha256_sum = hashlib.sha256(archive_file.read_bytes()).hexdigest()
261+ checksum_file = archive_file.with_suffix(archive_file.suffix + ".sha256")
262+ checksum_file.write_text(f"{sha256_sum} $archive\\n")
263+ EOF
269264 echo "✓ Packaged : $archive"
270265 done
271266
You can’t perform that action at this time.
0 commit comments