Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: package sources in a folder #1332

Merged
merged 1 commit into from
Mar 18, 2023
Merged
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
14 changes: 6 additions & 8 deletions x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -225,21 +223,21 @@ 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')
run(gpg, '--detach-sign', '--armor', tarball)

# 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()
Expand Down