Skip to content

Commit ad48962

Browse files
authored
ci: publish debug symbols to R2 (#18784)
1 parent 5e46381 commit ad48962

File tree

2 files changed

+78
-43
lines changed

2 files changed

+78
-43
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Publish Debug Symbols"
2+
description: "Publish debug symbols to GitHub releases and R2"
3+
inputs:
4+
version:
5+
description: "Release version"
6+
required: true
7+
target:
8+
description: "Release target"
9+
required: true
10+
category:
11+
description: "Release default/docker"
12+
required: false
13+
default: default
14+
sha:
15+
description: "Git SHA for artifact download"
16+
required: true
17+
18+
runs:
19+
using: "composite"
20+
steps:
21+
- name: Download artifact
22+
uses: ./.github/actions/artifact_download
23+
with:
24+
sha: ${{ inputs.sha }}
25+
target: ${{ inputs.target }}
26+
category: ${{ inputs.category }}
27+
artifacts: query.debug
28+
path: distro/bin
29+
30+
- name: Prepare artifact
31+
id: prepare
32+
shell: bash
33+
run: |
34+
publish_name="databend-query-${{ inputs.category }}-${{ inputs.version }}-${{ inputs.target }}.debug.tar.gz"
35+
tar -C distro/bin -czvf ${publish_name} databend-query.debug
36+
echo "name=$publish_name" >> $GITHUB_OUTPUT
37+
38+
- name: Update debug symbols to github
39+
shell: bash
40+
run: |
41+
gh release upload ${{ inputs.version }} ${{ steps.prepare.outputs.name }} --clobber
42+
43+
- name: Sync debug symbols to R2
44+
shell: bash
45+
continue-on-error: true
46+
if: inputs.category == 'default'
47+
run: |
48+
aws s3 cp ${{ steps.prepare.outputs.name }} s3://repo/databend/${{ inputs.version }}/${{ steps.prepare.outputs.name }} --no-progress --checksum-algorithm=CRC32

.github/workflows/release.yml

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -230,49 +230,6 @@ jobs:
230230
target: ${{ matrix.target }}
231231
category: default
232232

233-
publish_dbg:
234-
runs-on:
235-
- self-hosted
236-
- ARM64
237-
- Linux
238-
- 2c8g
239-
- aws
240-
needs: [ create_release, build_default, build_docker ]
241-
strategy:
242-
fail-fast: false
243-
matrix:
244-
category:
245-
- default
246-
- docker
247-
target:
248-
- x86_64-unknown-linux-gnu
249-
- aarch64-unknown-linux-gnu
250-
steps:
251-
- name: Checkout
252-
uses: actions/checkout@v4
253-
with:
254-
ref: ${{ needs.create_release.outputs.sha }}
255-
- name: Download artifact
256-
uses: ./.github/actions/artifact_download
257-
with:
258-
sha: ${{ github.sha }}
259-
target: ${{ matrix.target }}
260-
category: ${{ matrix.category }}
261-
artifacts: query.debug
262-
path: distro/bin
263-
- name: Prepare artifact
264-
id: prepare
265-
run: |
266-
publish_name="databend-query-${{ matrix.category }}-${{ needs.create_release.outputs.version }}-${{ matrix.target }}.debug.gz"
267-
gzip distro/bin/databend-query.debug
268-
mv distro/bin/databend-query.debug.gz ${publish_name}
269-
echo "publish_name=${publish_name}" >> $GITHUB_OUTPUT
270-
- name: Upload to Release
271-
env:
272-
GH_TOKEN: ${{ github.token }}
273-
run: |
274-
gh release upload ${{ needs.create_release.outputs.version }} ${{ steps.prepare.outputs.publish_name }} --clobber
275-
276233
publish_testsuite:
277234
runs-on:
278235
- self-hosted
@@ -323,6 +280,36 @@ jobs:
323280
target: ${{ matrix.target }}
324281
category: testsuite
325282

283+
publish_dbg:
284+
runs-on:
285+
- self-hosted
286+
- ARM64
287+
- Linux
288+
- 2c8g
289+
- aws
290+
needs: [ create_release, build_default, build_docker ]
291+
strategy:
292+
fail-fast: false
293+
matrix:
294+
category:
295+
- default
296+
- docker
297+
target:
298+
- x86_64-unknown-linux-gnu
299+
- aarch64-unknown-linux-gnu
300+
steps:
301+
- name: Checkout
302+
uses: actions/checkout@v4
303+
with:
304+
ref: ${{ needs.create_release.outputs.sha }}
305+
- name: Publish Debug Symbols
306+
uses: ./.github/actions/publish_debug_symbols
307+
with:
308+
version: ${{ needs.create_release.outputs.version }}
309+
target: ${{ matrix.target }}
310+
category: ${{ matrix.category }}
311+
sha: ${{ github.sha }}
312+
326313
docker_all_in_one:
327314
runs-on:
328315
- self-hosted

0 commit comments

Comments
 (0)