Skip to content

ci: align Linux release bundle with DuckDB #13

ci: align Linux release bundle with DuckDB

ci: align Linux release bundle with DuckDB #13

Workflow file for this run

name: Release Paimon Extension Bundle
env:
duckdb_version: v1.5.3
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Release tag"
required: true
type: string
permissions:
contents: write
jobs:
build-bundles:
name: Build and package (${{ matrix.bundle_arch }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- bundle_arch: linux-amd64
runner: ubuntu-24.04
manylinux_image: x86_64
- bundle_arch: linux-arm64
runner: ubuntu-24.04-arm
manylinux_image: aarch64
- bundle_arch: osx-arm64
runner: macos-14
steps:
- name: Checkout source
uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: Set release tag
id: tag
shell: bash
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "value=${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}"
else
echo "value=${{ inputs.tag }}" >> "${GITHUB_OUTPUT}"
fi
- name: Ensure DuckDB version metadata
shell: bash
run: |
set -euo pipefail
git -C duckdb fetch --force --tags
git -C duckdb describe --tags --long
- name: Build extension (release, Linux)
if: startsWith(matrix.bundle_arch, 'linux-')
shell: bash
run: |
set -euo pipefail
WORKSPACE="$(pwd)"
docker run --rm \
-v "${WORKSPACE}:${WORKSPACE}" \
-e GEN=ninja \
-e CC=gcc \
-e CXX=g++ \
quay.io/pypa/manylinux_2_28_${{ matrix.manylinux_image }} \
bash -c "
set -euo pipefail
umask 022
cat /etc/os-release
dnf install -y \
ninja-build \
perl-IPC-Cmd
git config --global --add safe.directory \"${WORKSPACE}\"
git config --global --add safe.directory \"${WORKSPACE}/duckdb\"
git config --global --add safe.directory \"${WORKSPACE}/extension-ci-tools\"
git config --global --add safe.directory \"${WORKSPACE}/third_party/paimon-cpp\"
make -C \"${WORKSPACE}\"
"
- name: Build extension (release, non-Linux)
if: ${{ !startsWith(matrix.bundle_arch, 'linux-') }}
shell: bash
run: |
if command -v ninja &>/dev/null; then
GEN=ninja make
else
make
fi
- name: Package release bundle
id: package
env:
EXT_DIR: build/release/extension/paimon
shell: bash
run: |
set -euo pipefail
TAG="${{ steps.tag.outputs.value }}"
PKG_NAME="duckdb-paimon-${TAG}-${duckdb_version}-${{ matrix.bundle_arch }}"
STAGE_DIR="dist/${PKG_NAME}"
mkdir -p "${STAGE_DIR}"
cp "${EXT_DIR}/paimon.duckdb_extension" "${STAGE_DIR}/"
case "${{ matrix.bundle_arch }}" in
linux-*) LIB_EXT="so" ;;
osx-*) LIB_EXT="dylib" ;;
esac
cp "${EXT_DIR}"/libpaimon*."${LIB_EXT}"* "${STAGE_DIR}/"
cp "${EXT_DIR}"/libjindosdk_c*."${LIB_EXT}"* "${STAGE_DIR}/"
cp LICENSE "${STAGE_DIR}/LICENSE"
cp README.md "${STAGE_DIR}/README.md"
tar -C dist -czf "dist/${PKG_NAME}.tar.gz" "${PKG_NAME}"
if command -v sha256sum &>/dev/null; then
sha256sum "dist/${PKG_NAME}.tar.gz" > "dist/${PKG_NAME}.tar.gz.sha256"
else
shasum -a 256 "dist/${PKG_NAME}.tar.gz" > "dist/${PKG_NAME}.tar.gz.sha256"
fi
echo "archive=dist/${PKG_NAME}.tar.gz" >> "${GITHUB_OUTPUT}"
echo "checksum=dist/${PKG_NAME}.tar.gz.sha256" >> "${GITHUB_OUTPUT}"
- name: Upload package artifact
uses: actions/upload-artifact@v7
with:
name: release-${{ matrix.bundle_arch }}
path: |
${{ steps.package.outputs.archive }}
${{ steps.package.outputs.checksum }}
if-no-files-found: error
retention-days: 7
publish-release:
name: Publish GitHub release assets
runs-on: ubuntu-22.04
needs: build-bundles
steps:
- name: Set release tag
id: tag
shell: bash
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "value=${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}"
else
echo "value=${{ inputs.tag }}" >> "${GITHUB_OUTPUT}"
fi
- name: Download all packaged artifacts
uses: actions/download-artifact@v8
with:
path: dist
pattern: release-*
merge-multiple: true
- name: Publish to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.value }}
target_commitish: ${{ github.sha }}
generate_release_notes: true
files: |
dist/*.tar.gz
dist/*.tar.gz.sha256