Skip to content

Commit 7889923

Browse files
committed
ci: try to release linux musl deb
1 parent b7a3bbb commit 7889923

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/databend-release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,52 @@ jobs:
346346
file: ./docker/${{ matrix.distro }}/${{ matrix.service }}.Dockerfile
347347
build-args: VERSION=${{ needs.create_release.outputs.version }}
348348

349+
release_packages:
350+
name: release packages
351+
runs-on: ubuntu-latest
352+
needs: [create_release, publish_linux]
353+
strategy:
354+
matrix:
355+
arch:
356+
- x86_64
357+
platform:
358+
- musl
359+
packager:
360+
- deb
361+
steps:
362+
- name: Checkout
363+
uses: actions/checkout@v3
364+
- name: Install nfpm@latest
365+
run: curl -o /tmp/nfpm.tar.gz -sSL https://github.com/goreleaser/nfpm/releases/download/v2.22.2/nfpm_2.22.2_Linux_x86_64.tar.gz && cd /tmp && tar xf /tmp/nfpm.tar.gz && sudo mv nfpm /usr/local/bin && sudo chmod a+x /usr/local/bin/nfpm
366+
- name: Get target
367+
id: target
368+
run: echo 'target=${{ matrix.arch }}-unknown-linux-${{ matrix.platform }}' >> $GITHUB_OUTPUT
369+
- name: Download binaries for usage
370+
id: download_binaries
371+
run: |
372+
target=${{ steps.target.outputs.target }}
373+
version="${{ needs.create_release.outputs.version }}"
374+
mkdir -p ./distro/
375+
wget -P distro -qc https://repo.databend.rs/databend/${version}/databend-${version}-${target}.tar.gz
376+
tar x -C distro -f ./distro/databend-${version}-${target}.tar.gz
377+
- name: Build Packages
378+
id: build_packages
379+
run: |
380+
export name="databend"
381+
export version="${{ needs.create_release.outputs.version }}"
382+
export path="distro"
383+
nfpm pkg --packager ${{ matrix.packager }} -f <(envsubst '${name} ${version} ${path}' < .github/actions/publish_binary/nfpm.yaml)
384+
- name: Update release to github
385+
shell: bash
386+
# Reference: https://cli.github.com/manual/gh_release_upload
387+
run: |
388+
target=${{ steps.target.outputs.target }}
389+
version="${{ needs.create_release.outputs.version }}"
390+
# name looks like: `databend_0.8.144~nightly_amd64.deb`
391+
gh release upload ${version} databend_*.${{ matrix.packager }} --clobber
392+
env:
393+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
394+
349395
upload-sha256sums-plugin:
350396
needs: [create_release, publish_linux, publish_macos]
351397
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)