ci: try to release linux musl deb
@@ -346,6 +346,52 @@ jobs:
file: ./docker/${{ matrix.distro }}/${{ matrix.service }}.Dockerfile
build-args: VERSION=${{ needs.create_release.outputs.version }}
+ release_packages:
+ name: release packages
+ runs-on: ubuntu-latest
+ needs: [create_release, publish_linux]
+ strategy:
+ matrix:
+ arch:
+ - x86_64
+ platform:
+ - musl
+ packager:
+ - deb
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install nfpm@latest
+ 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
+ - name: Get target
+ id: target
+ run: echo 'target=${{ matrix.arch }}-unknown-linux-${{ matrix.platform }}' >> $GITHUB_OUTPUT
+ - name: Download binaries for usage
+ id: download_binaries
+ run: |
+ target=${{ steps.target.outputs.target }}
+ version="${{ needs.create_release.outputs.version }}"
+ mkdir -p ./distro/
+ wget -P distro -qc https://repo.databend.rs/databend/${version}/databend-${version}-${target}.tar.gz
+ tar x -C distro -f ./distro/databend-${version}-${target}.tar.gz
+ - name: Build Packages
+ id: build_packages
+ run: |
+ export name="databend"
+ export version="${{ needs.create_release.outputs.version }}"
+ export path="distro"
+ nfpm pkg --packager ${{ matrix.packager }} -f <(envsubst '${name} ${version} ${path}' < .github/actions/publish_binary/nfpm.yaml)
+ - name: Update release to github
+ shell: bash
+ # Reference: https://cli.github.com/manual/gh_release_upload
+ run: |
+ target=${{ steps.target.outputs.target }}
+ version="${{ needs.create_release.outputs.version }}"
+ # name looks like: `databend_0.8.144~nightly_amd64.deb`
+ gh release upload ${version} databend_*.${{ matrix.packager }} --clobber
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
upload-sha256sums-plugin:
needs: [create_release, publish_linux, publish_macos]
runs-on: ubuntu-latest
