Skip to content

Commit 51d95dd

Browse files
authored
ci: fix deb pkg version (#17847)
1 parent d12ab68 commit 51d95dd

File tree

4 files changed

+20
-33
lines changed

4 files changed

+20
-33
lines changed

.github/actions/pack_deb/action.yml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,47 +42,34 @@ runs:
4242
export version="${{ inputs.version }}"
4343
case "${{ inputs.arch }}" in
4444
x86_64)
45-
echo "deb_arch=amd64" >> $GITHUB_OUTPUT
45+
echo "arch=amd64" >> $GITHUB_OUTPUT
4646
;;
4747
aarch64)
48-
echo "deb_arch=arm64" >> $GITHUB_OUTPUT
48+
echo "arch=arm64" >> $GITHUB_OUTPUT
4949
;;
5050
*)
5151
echo "Unsupported arch: ${{ inputs.arch }}"
5252
exit 1
5353
;;
5454
esac
55-
deb_version=${version/-/.}
56-
echo "deb_version=${deb_version/v/}" >> $GITHUB_OUTPUT
57-
mkdir -p distro/{bin,configs,systemd,scripts}
55+
deb_version=${version/-/'~'}
56+
echo "version=${deb_version/v/}" >> $GITHUB_OUTPUT
57+
mkdir -p distro/{bin,configs,systemd,scripts,pkg}
5858
cp ./scripts/distribution/systemd/databend-* distro/systemd/
5959
cp ./scripts/distribution/configs/databend-* distro/configs/
6060
cp ./scripts/distribution/release-readme.txt distro/readme.txt
6161
cp -r ./scripts/distribution/package-scripts/* distro/scripts/
6262
63-
- name: Build Databend Query Package
63+
- name: Build Databend Packages
6464
shell: bash
6565
run: |
66-
yq -i '.arch = "${{ steps.info.outputs.deb_arch }}"' scripts/distribution/nfpm-query.yaml
67-
yq -i '.version = "${{ steps.info.outputs.deb_version }}"' scripts/distribution/nfpm-query.yaml
68-
pkg_name="databend-query_${{ steps.info.outputs.deb_version }}_${{ steps.info.outputs.deb_arch }}.deb"
69-
nfpm pkg --packager deb -t "distro/${pkg_name}" -f scripts/distribution/nfpm-query.yaml
70-
71-
- name: Build Databend Meta Package
72-
shell: bash
73-
run: |
74-
yq -i '.arch = "${{ steps.info.outputs.deb_arch }}"' scripts/distribution/nfpm-meta.yaml
75-
yq -i '.version = "${{ steps.info.outputs.deb_version }}"' scripts/distribution/nfpm-meta.yaml
76-
pkg_name="databend-meta_${{ steps.info.outputs.deb_version }}_${{ steps.info.outputs.deb_arch }}.deb"
77-
nfpm pkg --packager deb -t "distro/${pkg_name}" -f scripts/distribution/nfpm-meta.yaml
78-
79-
- name: Build Databend Debug Package
80-
shell: bash
81-
run: |
82-
yq -i '.arch = "${{ steps.info.outputs.deb_arch }}"' scripts/distribution/nfpm-query-dbg.yaml
83-
yq -i '.version = "${{ steps.info.outputs.deb_version }}"' scripts/distribution/nfpm-query-dbg.yaml
84-
pkg_name="databend-query-dbg_${{ steps.info.outputs.deb_version }}_${{ steps.info.outputs.deb_arch }}.deb"
85-
nfpm pkg --packager deb -t "distro/${pkg_name}" -f scripts/distribution/nfpm-query-dbg.yaml
66+
pkgs="query meta query-dbg"
67+
for pkg in $pkgs; do
68+
yq -i '.arch = "${{ steps.info.outputs.arch }}"' scripts/distribution/nfpm-${pkg}.yaml
69+
yq -i '.version = "${{ steps.info.outputs.version }}"' scripts/distribution/nfpm-${pkg}.yaml
70+
nfpm pkg --packager deb --target distro/pkg -f scripts/distribution/nfpm-${pkg}.yaml
71+
done
72+
ls -lh distro/pkg
8673
8774
- name: Update release to github
8875
shell: bash
@@ -92,6 +79,6 @@ runs:
9279
run: |
9380
version="${{ inputs.version }}"
9481
# name looks like: `databend_0.8.144~nightly_amd64.deb`
95-
for pkg in $(ls distro/*.deb); do
82+
for pkg in $(ls distro/pkg/*.deb); do
9683
gh release upload ${version} $pkg --clobber
9784
done

scripts/distribution/nfpm-meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "databend-meta"
2-
arch: "${arch}"
2+
arch: ""
33
platform: "linux"
4-
version: "${version}"
4+
version: ""
55
section: "database"
66
priority: "extra"
77
maintainer: "Databend Labs <opensource@databend.com>"

scripts/distribution/nfpm-query-dbg.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "databend-query-dbg"
2-
arch: "${arch}"
2+
arch: ""
33
platform: "linux"
4-
version: "${version}"
4+
version: ""
55
section: "database"
66
priority: "extra"
77
maintainer: "Databend Labs <opensource@databend.com>"

scripts/distribution/nfpm-query.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "databend-query"
2-
arch: "${arch}"
2+
arch: ""
33
platform: "linux"
4-
version: "${version}"
4+
version: ""
55
section: "database"
66
priority: "extra"
77
maintainer: "Databend Labs <opensource@databend.com>"

0 commit comments

Comments
 (0)