Skip to content

Commit 6f14137

Browse files
authored
Merge pull request #1079 from Altinity/builds/25.8-source-upload
25.8 Add source code upload job
2 parents 410f2f3 + 1c92079 commit 6f14137

File tree

8 files changed

+147
-3
lines changed

8 files changed

+147
-3
lines changed

.github/workflows/master.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4327,3 +4327,38 @@ jobs:
43274327
with:
43284328
workflow_config: ${{ needs.config_workflow.outputs.data }}
43294329
final: true
4330+
4331+
SourceUpload:
4332+
needs: [config_workflow, build_amd_release]
4333+
if: ${{ !failure() && !cancelled() }}
4334+
runs-on: [self-hosted, altinity-on-demand, altinity-style-checker-aarch64]
4335+
env:
4336+
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
4337+
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
4338+
VERSION: ${{ fromJson(needs.config_workflow.outputs.data).custom_data.version.string }}
4339+
steps:
4340+
- name: Check out repository code
4341+
uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6
4342+
with:
4343+
clear-repository: true
4344+
ref: ${{ fromJson(needs.config_workflow.outputs.data).git_ref }}
4345+
submodules: true
4346+
fetch-depth: 0
4347+
filter: tree:0
4348+
- name: Install aws cli
4349+
uses: unfor19/install-aws-cli-action@v1
4350+
with:
4351+
version: 2
4352+
arch: arm64
4353+
- name: Create source tar
4354+
run: |
4355+
cd .. && tar czf $RUNNER_TEMP/build_source.src.tar.gz ClickHouse/
4356+
- name: Upload source tar
4357+
run: |
4358+
if [ "$PR_NUMBER" -eq 0 ]; then
4359+
S3_PATH="REFs/$GITHUB_REF_NAME/$COMMIT_SHA/build_amd_release"
4360+
else
4361+
S3_PATH="PRs/$PR_NUMBER/$COMMIT_SHA/build_amd_release"
4362+
fi
4363+
4364+
aws s3 cp $RUNNER_TEMP/build_source.src.tar.gz s3://altinity-build-artifacts/$S3_PATH/clickhouse-$VERSION.src.tar.gz

.github/workflows/pull_request.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,3 +4261,38 @@ jobs:
42614261
with:
42624262
workflow_config: ${{ needs.config_workflow.outputs.data }}
42634263
final: true
4264+
4265+
SourceUpload:
4266+
needs: [config_workflow, build_amd_release]
4267+
if: ${{ !failure() && !cancelled() }}
4268+
runs-on: [self-hosted, altinity-on-demand, altinity-style-checker-aarch64]
4269+
env:
4270+
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
4271+
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
4272+
VERSION: ${{ fromJson(needs.config_workflow.outputs.data).custom_data.version.string }}
4273+
steps:
4274+
- name: Check out repository code
4275+
uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6
4276+
with:
4277+
clear-repository: true
4278+
ref: ${{ fromJson(needs.config_workflow.outputs.data).git_ref }}
4279+
submodules: true
4280+
fetch-depth: 0
4281+
filter: tree:0
4282+
- name: Install aws cli
4283+
uses: unfor19/install-aws-cli-action@v1
4284+
with:
4285+
version: 2
4286+
arch: arm64
4287+
- name: Create source tar
4288+
run: |
4289+
cd .. && tar czf $RUNNER_TEMP/build_source.src.tar.gz ClickHouse/
4290+
- name: Upload source tar
4291+
run: |
4292+
if [ "$PR_NUMBER" -eq 0 ]; then
4293+
S3_PATH="REFs/$GITHUB_REF_NAME/$COMMIT_SHA/build_amd_release"
4294+
else
4295+
S3_PATH="PRs/$PR_NUMBER/$COMMIT_SHA/build_amd_release"
4296+
fi
4297+
4298+
aws s3 cp $RUNNER_TEMP/build_source.src.tar.gz s3://altinity-build-artifacts/$S3_PATH/clickhouse-$VERSION.src.tar.gz

.github/workflows/release_builds.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,3 +1208,38 @@ jobs:
12081208
with:
12091209
workflow_config: ${{ needs.config_workflow.outputs.data }}
12101210
final: true
1211+
1212+
SourceUpload:
1213+
needs: [config_workflow, build_amd_release]
1214+
if: ${{ !failure() && !cancelled() }}
1215+
runs-on: [self-hosted, altinity-on-demand, altinity-style-checker-aarch64]
1216+
env:
1217+
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
1218+
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
1219+
VERSION: ${{ fromJson(needs.config_workflow.outputs.data).custom_data.version.string }}
1220+
steps:
1221+
- name: Check out repository code
1222+
uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6
1223+
with:
1224+
clear-repository: true
1225+
ref: ${{ fromJson(needs.config_workflow.outputs.data).git_ref }}
1226+
submodules: true
1227+
fetch-depth: 0
1228+
filter: tree:0
1229+
- name: Install aws cli
1230+
uses: unfor19/install-aws-cli-action@v1
1231+
with:
1232+
version: 2
1233+
arch: arm64
1234+
- name: Create source tar
1235+
run: |
1236+
cd .. && tar czf $RUNNER_TEMP/build_source.src.tar.gz ClickHouse/
1237+
- name: Upload source tar
1238+
run: |
1239+
if [ "$PR_NUMBER" -eq 0 ]; then
1240+
S3_PATH="REFs/$GITHUB_REF_NAME/$COMMIT_SHA/build_amd_release"
1241+
else
1242+
S3_PATH="PRs/$PR_NUMBER/$COMMIT_SHA/build_amd_release"
1243+
fi
1244+
1245+
aws s3 cp $RUNNER_TEMP/build_source.src.tar.gz s3://altinity-build-artifacts/$S3_PATH/clickhouse-$VERSION.src.tar.gz

ci/praktika/yaml_additional_templates.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,42 @@ class AltinityWorkflowTemplates:
123123
with:
124124
workflow_config: ${{ needs.config_workflow.outputs.data }}
125125
final: true
126+
""",
127+
"SourceUpload": r"""
128+
SourceUpload:
129+
needs: [config_workflow, build_amd_release]
130+
if: ${{ !failure() && !cancelled() }}
131+
runs-on: [self-hosted, altinity-on-demand, altinity-style-checker-aarch64]
132+
env:
133+
COMMIT_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
134+
PR_NUMBER: ${{ github.event.pull_request.number || 0 }}
135+
VERSION: ${{ fromJson(needs.config_workflow.outputs.data).custom_data.version.string }}
136+
steps:
137+
- name: Check out repository code
138+
uses: Altinity/checkout@19599efdf36c4f3f30eb55d5bb388896faea69f6
139+
with:
140+
clear-repository: true
141+
ref: ${{ fromJson(needs.config_workflow.outputs.data).git_ref }}
142+
submodules: true
143+
fetch-depth: 0
144+
filter: tree:0
145+
- name: Install aws cli
146+
uses: unfor19/install-aws-cli-action@v1
147+
with:
148+
version: 2
149+
arch: arm64
150+
- name: Create source tar
151+
run: |
152+
cd .. && tar czf $RUNNER_TEMP/build_source.src.tar.gz ClickHouse/
153+
- name: Upload source tar
154+
run: |
155+
if [ "$PR_NUMBER" -eq 0 ]; then
156+
S3_PATH="REFs/$GITHUB_REF_NAME/$COMMIT_SHA/build_amd_release"
157+
else
158+
S3_PATH="PRs/$PR_NUMBER/$COMMIT_SHA/build_amd_release"
159+
fi
160+
161+
aws s3 cp $RUNNER_TEMP/build_source.src.tar.gz s3://altinity-build-artifacts/$S3_PATH/clickhouse-$VERSION.src.tar.gz
126162
""",
127163
}
128164
ADDITIONAL_JOBS_BANNER = r"""

ci/praktika/yaml_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ def generate(self):
519519
res += AltinityWorkflowTemplates.ALTINITY_JOBS["CIReport"].replace(
520520
"{ALL_JOBS}", ALL_JOBS
521521
)
522+
if "SourceUpload" in self.workflow_config.additional_jobs:
523+
res += AltinityWorkflowTemplates.ALTINITY_JOBS["SourceUpload"]
524+
ALL_JOBS += "\n - SourceUpload"
522525

523526
return res
524527

ci/workflows/master.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
# *JobConfigs.sqlancer_master_jobs,
4141
JobConfigs.sqltest_master_job,
4242
],
43-
additional_jobs=["GrypeScan", "Regression", "SignRelease", "CIReport"],
43+
additional_jobs=["GrypeScan", "Regression", "SignRelease", "CIReport", "SourceUpload"],
4444
artifacts=[
4545
*ArtifactConfigs.unittests_binaries,
4646
*ArtifactConfigs.clickhouse_binaries,

ci/workflows/pull_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
# for job in JobConfigs.performance_comparison_with_master_head_jobs
107107
# ], # NOTE (strtgbb): failed previously due to GH secrets not being handled properly, try again later
108108
],
109-
additional_jobs=["GrypeScan", "Regression", "CIReport"],
109+
additional_jobs=["GrypeScan", "Regression", "CIReport", "SourceUpload"],
110110
artifacts=[
111111
*ArtifactConfigs.unittests_binaries,
112112
*ArtifactConfigs.clickhouse_binaries,

ci/workflows/release_builds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
if any(t in job.name for t in ("release", "binary"))
4040
],
4141
],
42-
additional_jobs=["GrypeScan", "SignRelease", "CIReport"],
42+
additional_jobs=["GrypeScan", "SignRelease", "CIReport", "SourceUpload"],
4343
artifacts=[
4444
*ArtifactConfigs.clickhouse_binaries,
4545
*ArtifactConfigs.clickhouse_stripped_binaries,

0 commit comments

Comments
 (0)