Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/release_candidate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release Candidate

on:
pull_request:
paths:
- ".github/workflows/release_candidate.yaml"
- ".github/.rat-excludes"
- "CMakeLists.txt"
- "LICENSE"
- "NOTICE"
- "docs/source/conf.py"
- "docs/source/_static/versions.json"
- "scripts/releasing/**"
push:
tags:
- "v*-rc*"

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read

jobs:
archive:
name: Create and audit source archive
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Run release tool tests
run: python3 -m unittest discover -s scripts/releasing/tests -v

- name: Resolve release version
shell: bash
run: |
version=$(
awk '$1 == "VERSION" && $2 ~ /^[0-9]+\.[0-9]+\.[0-9]+$/ {
print $2
exit
}' CMakeLists.txt
)
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
tag_version=${GITHUB_REF_NAME#v}
tag_version=${tag_version%-rc*}
[[ "${tag_version}" == "${version}" ]]
fi
scripts/releasing/bump_version.py --check "${version}"
echo "RELEASE_VERSION=${version}" >> "${GITHUB_ENV}"

- name: Create source archive
run: |
scripts/releasing/create_source_release.sh \
--version "${RELEASE_VERSION}" \
--git-ref HEAD \
--output-dir release/ci

- name: Audit source archive
run: |
scripts/releasing/verify_release_candidate.sh \
--allow-unsigned \
--skip-build \
"release/ci/apache-paimon-cpp-${RELEASE_VERSION}-src.tgz"

- name: Upload source archive
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: source-archive
path: release/ci/
if-no-files-found: error

verify:
name: Verify source archive (${{ matrix.compiler }})
if: github.ref_type == 'tag'
needs: archive
runs-on: ubuntu-24.04
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
compiler:
- gcc-14
- clang
include:
- compiler: gcc-14
cc: gcc-14
cxx: g++-14
- compiler: clang
cc: clang
cxx: clang++
steps:
- name: Checkout source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

- name: Download source archive
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: source-archive
path: release/ci

- name: Verify, build, test, and install
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
artifact=$(find release/ci -name 'apache-paimon-cpp-*-src.tgz' -print -quit)
scripts/releasing/verify_release_candidate.sh \
--allow-unsigned \
--skip-rat \
"${artifact}"
45 changes: 43 additions & 2 deletions ci/scripts/build_paimon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,19 @@ source_dir=${1}
enable_sanitizer=${2:-false}
check_clang_tidy=${3:-false}
build_type=${4:-Debug}
install_smoke=${5:-false}
build_dir="${source_dir}/build"

if [[ -n "${PAIMON_BUILD_JOBS:-}" ]]; then
build_jobs="${PAIMON_BUILD_JOBS}"
elif command -v nproc >/dev/null 2>&1; then
build_jobs=$(nproc)
elif command -v sysctl >/dev/null 2>&1; then
build_jobs=$(sysctl -n hw.ncpu)
else
build_jobs=4
fi

# Display ccache status if available
if command -v ccache &> /dev/null; then
echo "=== ccache found: $(ccache --version | head -1) ==="
Expand Down Expand Up @@ -57,13 +68,40 @@ if [[ "${enable_sanitizer}" == "true" ]]; then
fi

cmake "${CMAKE_ARGS[@]}" "${source_dir}"
cmake --build . -- -j "$(nproc)"
ctest --output-on-failure -j "$(nproc)"
cmake --build . -- -j "${build_jobs}"
ctest --output-on-failure -j "${build_jobs}"

if [[ "${check_clang_tidy}" == "true" ]]; then
cmake --build . --target check-clang-tidy
fi

if [[ "${install_smoke}" == "true" ]]; then
install_dir="${source_dir}/install-test"
smoke_build_dir="${source_dir}/build-install-smoke"
rm -rf "${install_dir}" "${smoke_build_dir}"

cmake --install . --prefix "${install_dir}"
cmake -G Ninja \
-S "${source_dir}/scripts/releasing/install_smoke" \
-B "${smoke_build_dir}" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="${install_dir};${build_dir}/arrow_ep-install"
cmake --build "${smoke_build_dir}" -- -j "${build_jobs}"

runtime_library_path="${install_dir}/lib:${install_dir}/lib64"
runtime_library_path+=":${build_dir}/arrow_ep-install/lib"
runtime_library_path+=":${build_dir}/arrow_ep-install/lib64"
if [[ "$(uname -s)" == "Darwin" ]]; then
cmake -E env \
"DYLD_LIBRARY_PATH=${runtime_library_path}" \
"${smoke_build_dir}/paimon_install_smoke"
else
cmake -E env \
"LD_LIBRARY_PATH=${runtime_library_path}" \
"${smoke_build_dir}/paimon_install_smoke"
fi
fi

# Print ccache statistics after build
if command -v ccache &> /dev/null; then
echo "=== ccache statistics after build ==="
Expand All @@ -73,3 +111,6 @@ fi
popd

rm -rf "${build_dir}"
if [[ "${install_smoke}" == "true" ]]; then
rm -rf "${install_dir}" "${smoke_build_dir}"
fi
3 changes: 2 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ if(TARGET Arrow::arrow_shared)
elseif(TARGET Arrow::arrow_static)
set(PAIMON_EXAMPLE_ARROW_TARGET Arrow::arrow_static)
else()
message(FATAL_ERROR "Neither Arrow::arrow_shared nor Arrow::arrow_static is available")
message(FATAL_ERROR "Neither Arrow::arrow_shared nor Arrow::arrow_static is available"
)
endif()

add_executable(read_write_demo read_write_demo.cpp)
Expand Down
Loading