Skip to content

Commit abce67b

Browse files
authored
Merge pull request #698 from Altinity/24.8/upload_src
24.8 Upload source code
2 parents 9cba74b + 5910cba commit abce67b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/reusable_build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ jobs:
9393
uses: ./.github/actions/common_setup
9494
with:
9595
job_type: build_check
96+
- name: Create source tar
97+
run: |
98+
mkdir -p "$TEMP_PATH/build_check/package_release"
99+
cd .. && tar czf $TEMP_PATH/build_source.src.tar.gz ClickHouse/
100+
cd $TEMP_PATH && tar xvzf $TEMP_PATH/build_source.src.tar.gz
96101
- name: Pre
97102
run: |
98103
python3 "$GITHUB_WORKSPACE/tests/ci/ci.py" --infile ${{ toJson(inputs.data) }} --pre --job-name '${{inputs.build_name}}'

tests/ci/build_check.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from git_helper import Git
1515
from pr_info import PRInfo, EventType
1616
from report import FAILURE, SUCCESS, JobReport, StatusType
17+
from s3_helper import S3Helper
1718
from stopwatch import Stopwatch
1819
from tee_popen import TeePopen
1920
from version_helper import (
@@ -223,6 +224,28 @@ def main():
223224
f"sudo chown -R ubuntu:ubuntu {build_output_path}", shell=True
224225
)
225226
logging.info("Build finished as %s, log path %s", build_status, log_path)
227+
228+
s3_helper = S3Helper()
229+
s3_path_prefix = "/".join(
230+
(
231+
get_release_or_pr(pr_info, get_version_from_repo())[0],
232+
pr_info.sha,
233+
build_name,
234+
)
235+
)
236+
src_path = temp_path / "build_source.src.tar.gz"
237+
s3_path = s3_path_prefix + "/clickhouse-" + version.string + ".src.tar.gz"
238+
logging.info("s3_path %s", s3_path)
239+
if src_path.exists():
240+
src_url = s3_helper.upload_build_file_to_s3(
241+
src_path, s3_path
242+
)
243+
logging.info("Source tar %s", src_url)
244+
print(f"::notice ::Source tar URL: {src_url}")
245+
else:
246+
logging.info("Source tar doesn't exist")
247+
print("Source tar doesn't exist")
248+
226249
if build_status != SUCCESS:
227250
# We check if docker works, because if it's down, it's infrastructure
228251
try:

0 commit comments

Comments
 (0)