From 7a8664614374c9b15d295f4ca8955816899230f2 Mon Sep 17 00:00:00 2001 From: tison Date: Sat, 18 Mar 2023 20:32:01 +0800 Subject: [PATCH] build: package sources in a folder Signed-off-by: tison --- x.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/x.py b/x.py index b2f934a4f04..f8d072fe898 100755 --- a/x.py +++ b/x.py @@ -25,8 +25,6 @@ from subprocess import Popen, PIPE import sys from typing import List, Any, Optional, TextIO, Tuple -from shutil import copyfile -from warnings import warn CMAKE_REQUIRE_VERSION = (3, 16, 0) CLANG_FORMAT_REQUIRED_VERSION = (12, 0, 0) @@ -225,10 +223,11 @@ def package_source(release_version: str) -> None: run(git, 'commit', '-a', '-m', f'[source-release] prepare release apache-kvrocks-{version}') run(git, 'tag', '-a', f'v{version}', '-m', f'[source-release] copy for tag v{version}') - tarball = f'apache-kvrocks-{version}-incubating-src.tar.gz' + # 2. Create the source tarball - output = run_pipe(git, 'ls-files') - run('xargs', 'tar', '-czf', tarball, stdin=output) + folder = f'apache-kvrocks-{version}-incubating-src' + tarball = f'apache-kvrocks-{version}-incubating-src.tar.gz' + run(git, 'archive', '--format=tar.gz', f'--output={tarball}', f'--prefix={folder}/', 'HEAD') # 3. GPG Sign gpg = find_command('gpg', msg='gpg is required for source packaging') @@ -236,10 +235,9 @@ def package_source(release_version: str) -> None: # 4. Generate sha512 checksum sha512sum = find_command('sha512sum', msg='sha512sum is required for source packaging') - output = run_pipe(sha512sum, tarball) - payload = output.read().strip() with open(f'{tarball}.sha512', 'w+') as f: - f.write(payload) + run(sha512sum, tarball, stdout=f) + def test_cpp(dir: str, rest: List[str]) -> None: basedir = Path(dir).absolute()