Skip to content

Commit 5e4b98f

Browse files
authored
ci: fix pack binaries (databendlabs#17544)
1 parent 5cbc165 commit 5e4b98f

4 files changed

Lines changed: 24 additions & 53 deletions

File tree

.github/actions/pack_binaries/action.yml

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
description: "Release target"
66
required: true
77
category:
8-
description: "Release default/hdfs/udf/testsuite"
8+
description: "Release default/hdfs/udf/testsuite/dbg"
99
required: false
1010
default: default
1111
version:
@@ -15,14 +15,24 @@ inputs:
1515
runs:
1616
using: "composite"
1717
steps:
18-
- name: Download artifact
18+
- name: Download artifact for dbg
19+
if: inputs.category == 'dbg'
1920
uses: ./.github/actions/artifact_download
2021
with:
2122
sha: ${{ github.sha }}
2223
target: ${{ inputs.target }}
23-
category: ${{ inputs.category }}
24+
category: default
2425
path: distro/bin
2526
artifacts: metactl,meta,query,query.debug
27+
- name: Download artifact for others
28+
if: inputs.category != 'dbg'
29+
uses: ./.github/actions/artifact_download
30+
with:
31+
sha: ${{ github.sha }}
32+
target: ${{ inputs.target }}
33+
category: ${{ inputs.category }}
34+
path: distro/bin
35+
artifacts: metactl,meta,query
2636
- name: Get Latest BendSQL
2737
id: bendsql
2838
uses: pozetroninc/github-action-get-latest-release@master
@@ -53,7 +63,7 @@ runs:
5363
cp ./scripts/distribution/configs/databend-* distro/configs/
5464
cp ./scripts/distribution/release-readme.txt distro/readme.txt
5565
cp -r ./scripts/distribution/package-scripts/* distro/scripts/
56-
tar -C ./distro --exclude='*.debug' -czvf ${pkg_name}.tar.gz bin configs systemd scripts readme.txt
66+
tar -C ./distro -czvf ${pkg_name}.tar.gz bin configs systemd scripts readme.txt
5767
sha256sum ${pkg_name}.tar.gz >> sha256-${pkg_name}.txt
5868
echo "pkg_name=$pkg_name" >> $GITHUB_OUTPUT
5969
- name: post sha256
@@ -68,37 +78,3 @@ runs:
6878
name: ${{ steps.pack_binaries.outputs.pkg_name }}.tar.gz
6979
path: ${{ steps.pack_binaries.outputs.pkg_name }}.tar.gz
7080
retention-days: 1
71-
- name: Pack DBG Binaries
72-
id: pack_dbg_binaries
73-
shell: bash
74-
run: |
75-
target=${{ inputs.target }}
76-
version=${{ inputs.version }}
77-
case ${{ inputs.category }} in
78-
default)
79-
pkg_name="databend-dbg-${version}-${target}"
80-
;;
81-
*)
82-
pkg_name="databend-dbg-${{ inputs.category }}-${version}-${target}"
83-
;;
84-
esac
85-
mkdir -p distro/{bin,configs,systemd,scripts}
86-
cp ./scripts/distribution/systemd/databend-* distro/systemd/
87-
cp ./scripts/distribution/configs/databend-* distro/configs/
88-
cp ./scripts/distribution/release-readme.txt distro/readme.txt
89-
cp -r ./scripts/distribution/package-scripts/* distro/scripts/
90-
tar -C ./distro -czvf ${pkg_name}.tar.gz bin configs systemd scripts readme.txt
91-
sha256sum ${pkg_name}.tar.gz >> sha256-${pkg_name}.txt
92-
echo "pkg_name=$pkg_name" >> $GITHUB_OUTPUT
93-
- name: post dbg sha256
94-
uses: actions/upload-artifact@v4
95-
with:
96-
name: sha256sums-${{ inputs.category }}-${{ inputs.target }}-gdb
97-
path: sha256-${{ steps.pack_dbg_binaries.outputs.pkg_name }}.txt
98-
retention-days: 1
99-
- name: post dbg binaries
100-
uses: actions/upload-artifact@v4
101-
with:
102-
name: ${{ steps.pack_dbg_binaries.outputs.pkg_name }}.tar.gz
103-
path: ${{ steps.pack_dbg_binaries.outputs.pkg_name }}.tar.gz
104-
retention-days: 1

.github/actions/pack_deb/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ runs:
6464
export deb_version="${{ steps.info.outputs.deb_version }}"
6565
export deb_arch="${{ steps.info.outputs.deb_arch }}"
6666
pkg_name="databend-query_${deb_version}_${deb_arch}.deb"
67-
nfpm pkg --packager deb -t "$pkg_name" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-query.yaml)
67+
nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-query.yaml)
6868
6969
- name: Build Databend Meta Package
7070
shell: bash
@@ -74,7 +74,7 @@ runs:
7474
export deb_version="${{ steps.info.outputs.deb_version }}"
7575
export deb_arch="${{ steps.info.outputs.deb_arch }}"
7676
pkg_name="databend-meta_${deb_version}_${deb_arch}.deb"
77-
nfpm pkg --packager deb -t "$pkg_name" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-meta.yaml)
77+
nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-meta.yaml)
7878
7979
- name: Build Databend Debug Package
8080
shell: bash
@@ -84,7 +84,7 @@ runs:
8484
export deb_version="${{ steps.info.outputs.deb_version }}"
8585
export deb_arch="${{ steps.info.outputs.deb_arch }}"
8686
pkg_name="databend-query-dbg_${deb_version}_${deb_arch}.deb"
87-
nfpm pkg --packager deb -t "$pkg_name" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-query-dbg.yaml)
87+
nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-query-dbg.yaml)
8888
8989
- name: Update release to github
9090
shell: bash

.github/actions/publish_binary/action.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
default)
2424
publish_name="databend-${{ inputs.version }}-${{ inputs.target }}"
2525
;;
26-
hdfs|udf|testsuite)
26+
hdfs|udf|testsuite|dbg)
2727
publish_name="databend-${{ inputs.category }}-${{ inputs.version }}-${{ inputs.target }}"
2828
;;
2929
*)
@@ -38,18 +38,12 @@ runs:
3838
# Reference: https://cli.github.com/manual/gh_release_upload
3939
run: |
4040
gh release upload ${{ inputs.version }} ${{ steps.name.outputs.name }}.tar.gz --clobber
41-
if [ -f ${{ steps.name.outputs.name }}-dbg.tar.gz ]; then
42-
gh release upload ${{ inputs.version }} ${{ steps.name.outputs.name }}-dbg.tar.gz --clobber
43-
fi
4441
4542
- name: Sync normal release to R2
4643
shell: bash
4744
if: inputs.category == 'default'
4845
run: |
4946
aws s3 cp ${{ steps.name.outputs.name }}.tar.gz s3://repo/databend/${{ inputs.version }}/${{ steps.name.outputs.name }}.tar.gz --no-progress --checksum-algorithm=CRC32
50-
if [ -f ${{ steps.name.outputs.name }}-dbg.tar.gz ]; then
51-
aws s3 cp ${{ steps.name.outputs.name }}-dbg.tar.gz s3://repo/databend/${{ inputs.version }}/${{ steps.name.outputs.name }}-dbg.tar.gz --no-progress --checksum-algorithm=CRC32
52-
fi
5347
gh api /repos/databendlabs/databend/tags > tags.json
5448
aws s3 cp ./tags.json s3://repo/databend/tags.json --no-progress --checksum-algorithm=CRC32
5549
gh api /repos/databendlabs/databend/releases > releases.json

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ jobs:
178178
strategy:
179179
fail-fast: false
180180
matrix:
181-
include:
182-
- category: default
183-
target: x86_64-unknown-linux-gnu
184-
- category: default
185-
target: aarch64-unknown-linux-gnu
181+
category:
182+
- default
183+
- dbg
184+
target:
185+
- x86_64-unknown-linux-gnu
186+
- aarch64-unknown-linux-gnu
186187
steps:
187188
- name: Checkout
188189
uses: actions/checkout@v4

0 commit comments

Comments
 (0)