ci(release): test and package five native platforms in one workflow

This commit is contained in:
eezd committed 2026-10-27 14:47:25 +08:00
1 parent e239fff253
commit 8934d566c1
3 files changed
+106 -24

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env python3
"""Package the already-tested native executable and licenses for a release."""
from pathlib import Path
import sys
import tarfile
import zipfile
system, arch = sys.argv[1:]
version = Path('VERSION').read_text().strip()
name = f'rawmark_{version}_{system}_{arch}'
package = Path('package')
files = sorted(p for p in package.rglob('*') if p.is_file())
if system == 'windows':
with zipfile.ZipFile(f'downloads/{name}.zip', 'w', compression=zipfile.ZIP_DEFLATED) as archive:
for file in files:
archive.write(file, file.relative_to(package).as_posix())
else:
with tarfile.open(f'downloads/{name}.tar.gz', 'w:gz') as archive:
for file in files:
archive.add(file, arcname=file.relative_to(package).as_posix())