@@ -42,49 +42,34 @@ runs:
42
42
export version="${{ inputs.version }}"
43
43
case "${{ inputs.arch }}" in
44
44
x86_64)
45
- echo "deb_arch =amd64" >> $GITHUB_OUTPUT
45
+ echo "arch =amd64" >> $GITHUB_OUTPUT
46
46
;;
47
47
aarch64)
48
- echo "deb_arch=arm64" >> $GITHUB_OUTPUT
48
+ echo "arch=arm64" >> $GITHUB_OUTPUT
49
+ ;;
50
+ *)
51
+ echo "Unsupported arch: ${{ inputs.arch }}"
52
+ exit 1
49
53
;;
50
54
esac
51
- deb_version=${version/-/. }
52
- echo "deb_version =${deb_version/v/}" >> $GITHUB_OUTPUT
53
- 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 }
54
58
cp ./scripts/distribution/systemd/databend-* distro/systemd/
55
59
cp ./scripts/distribution/configs/databend-* distro/configs/
56
60
cp ./scripts/distribution/release-readme.txt distro/readme.txt
57
61
cp -r ./scripts/distribution/package-scripts/* distro/scripts/
58
62
59
- - name : Build Databend Query Package
60
- shell : bash
61
- run : |
62
- export path="distro"
63
- export version="${{ inputs.version }}"
64
- export deb_version="${{ steps.info.outputs.deb_version }}"
65
- export deb_arch="${{ steps.info.outputs.deb_arch }}"
66
- pkg_name="databend-query_${deb_version}_${deb_arch}.deb"
67
- nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-query.yaml)
68
-
69
- - name : Build Databend Meta Package
63
+ - name : Build Databend Packages
70
64
shell : bash
71
65
run : |
72
- export path="distro"
73
- export version="${{ inputs.version }}"
74
- export deb_version="${{ steps.info.outputs.deb_version }}"
75
- export deb_arch="${{ steps.info.outputs.deb_arch }}"
76
- pkg_name="databend-meta_${deb_version}_${deb_arch}.deb"
77
- nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < scripts/distribution/nfpm-meta.yaml)
78
-
79
- - name : Build Databend Debug Package
80
- shell : bash
81
- run : |
82
- export path="distro"
83
- export version="${{ inputs.version }}"
84
- export deb_version="${{ steps.info.outputs.deb_version }}"
85
- export deb_arch="${{ steps.info.outputs.deb_arch }}"
86
- pkg_name="databend-query-dbg_${deb_version}_${deb_arch}.deb"
87
- nfpm pkg --packager deb -t "${path}/${pkg_name}" -f <(envsubst '${version} ${path} ${arch}' < 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
88
73
89
74
- name : Update release to github
90
75
shell : bash
94
79
run : |
95
80
version="${{ inputs.version }}"
96
81
# name looks like: `databend_0.8.144~nightly_amd64.deb`
97
- for pkg in $(ls distro/*.deb); do
82
+ for pkg in $(ls distro/pkg/ *.deb); do
98
83
gh release upload ${version} $pkg --clobber
99
84
done
0 commit comments