Skip to content

Commit 49dabbc

Browse files
committed
chore: prepare Apache Paimon C++ 0.2.3 release
1 parent 944fbc6 commit 49dabbc

8 files changed

Lines changed: 495 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ build
2020
build-release
2121
build-debug
2222
output
23+
release
2324

2425
# IDE settings
2526
.idea

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if(NOT CMAKE_BUILD_TYPE)
3737
endif()
3838

3939
project(paimon
40-
VERSION 0.2.0
40+
VERSION 0.2.3
4141
DESCRIPTION "Paimon C++ Project")
4242

4343
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPERCASE_BUILD_TYPE)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ cp devcontainer.json.template devcontainer.json
7575
## Collaboration
7676

7777
Paimon-cpp is an active open-source project and we welcome people who want to contribute or share good ideas!
78-
Before contributing, please read the [Contributing Guide](CONTRIBUTING.md) and the [Code Style Guide](docs/code-style.md). You are encouraged to check out our [documentation](https://alibaba.github.io/paimon-cpp/).
78+
Before contributing, please read the [Contributing Guide](CONTRIBUTING.md) and the [Code Style Guide](docs/code-style.md). You are encouraged to check out our [documentation](https://paimon.apache.org/docs/cpp/).
7979

8080
## License
8181

docs/source/_static/versions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
3-
"name": "0.10.0 (dev)",
4-
"version": "dev/",
5-
"url": "#"
3+
"name": "0.2.3",
4+
"version": "0.2.3",
5+
"url": "https://paimon.apache.org/docs/cpp/"
66
}
77
]

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
# The master toctree document.
115115
master_doc = "index"
116116

117-
version = "0.2.0"
117+
version = "0.2.3"
118118

119119
html_theme_options = {
120120
"show_toc_level": 2,

scripts/releasing/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
-->
19+
20+
# Apache Paimon C++ release scripts
21+
22+
These scripts create and verify the source artifact voted on by the Apache Paimon
23+
PMC. They do not publish artifacts, create tags, or move files between Apache
24+
distribution repositories.
25+
26+
## Create a release candidate
27+
28+
Create and push a signed RC tag before creating the source artifact:
29+
30+
```bash
31+
git tag -s release-0.2.3-rc1 -m "Apache Paimon C++ 0.2.3 RC1"
32+
git push upstream release-0.2.3-rc1
33+
```
34+
35+
Create the source artifact, SHA-512 checksum, and detached OpenPGP signature:
36+
37+
```bash
38+
scripts/releasing/create_source_release.sh \
39+
--version 0.2.3 \
40+
--git-ref release-0.2.3-rc1 \
41+
--output-dir release/0.2.3-rc1 \
42+
--signing-key ASF_GPG_KEY_ID
43+
```
44+
45+
The output files are:
46+
47+
```text
48+
apache-paimon-cpp-0.2.3-src.tgz
49+
apache-paimon-cpp-0.2.3-src.tgz.asc
50+
apache-paimon-cpp-0.2.3-src.tgz.sha512
51+
```
52+
53+
Existing files are never overwritten. A changed candidate must use a new RC
54+
directory and a new vote.
55+
56+
## Verify a release candidate
57+
58+
Download the source artifact, its `.asc` and `.sha512` files, and the Paimon
59+
`KEYS` file. Import `KEYS` into a temporary or dedicated GPG keyring, then run:
60+
61+
```bash
62+
RAT_JAR=/path/to/apache-rat-0.16.1.jar \
63+
scripts/releasing/verify_release_candidate.sh \
64+
apache-paimon-cpp-0.2.3-src.tgz
65+
```
66+
67+
The verifier checks:
68+
69+
- the SHA-512 checksum and detached OpenPGP signature;
70+
- archive paths and the single `paimon-cpp-0.2.3/` root directory;
71+
- required `LICENSE`, `NOTICE`, build, and documentation files;
72+
- the CMake and documentation versions;
73+
- absence of common compiled artifact types;
74+
- Apache RAT results;
75+
- a release build and the test suite from the extracted source archive.
76+
77+
The `--allow-unsigned` and `--skip-rat` options are only for local development
78+
of the release process. A voter may use `--skip-build` when the repository's
79+
Linux CI build command is not suitable for their platform, but must then build
80+
and test the extracted source distribution separately before casting a binding
81+
vote.
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
set -euo pipefail
21+
22+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
23+
SOURCE_ROOT=$(cd "${SCRIPT_DIR}/../.." && pwd)
24+
25+
RELEASE_VERSION=""
26+
GIT_REF=""
27+
OUTPUT_DIR="${SOURCE_ROOT}/release"
28+
SIGNING_KEY=""
29+
30+
usage() {
31+
cat <<'EOF'
32+
Create an Apache Paimon C++ source release from an immutable Git ref.
33+
34+
Usage:
35+
create_source_release.sh --version VERSION --git-ref REF [options]
36+
37+
Required:
38+
--version VERSION Release version, for example 0.2.3
39+
--git-ref REF Commit or signed RC tag to archive
40+
41+
Options:
42+
--output-dir DIR Output directory (default: <repository>/release)
43+
--signing-key KEY_ID Create an ASCII-armored detached OpenPGP signature
44+
-h, --help Show this help
45+
46+
The script creates:
47+
apache-paimon-cpp-VERSION-src.tgz
48+
apache-paimon-cpp-VERSION-src.tgz.sha512
49+
apache-paimon-cpp-VERSION-src.tgz.asc (when --signing-key is provided)
50+
51+
Existing artifacts are never overwritten.
52+
EOF
53+
}
54+
55+
fail() {
56+
echo "Error: $*" >&2
57+
exit 1
58+
}
59+
60+
calculate_sha512() {
61+
local file=$1
62+
if command -v sha512sum >/dev/null 2>&1; then
63+
sha512sum "${file}" | awk '{print $1}'
64+
elif command -v shasum >/dev/null 2>&1; then
65+
shasum -a 512 "${file}" | awk '{print $1}'
66+
else
67+
fail "sha512sum or shasum is required"
68+
fi
69+
}
70+
71+
while [[ $# -gt 0 ]]; do
72+
case "$1" in
73+
--version)
74+
[[ $# -ge 2 ]] || fail "--version requires a value"
75+
RELEASE_VERSION=$2
76+
shift 2
77+
;;
78+
--git-ref)
79+
[[ $# -ge 2 ]] || fail "--git-ref requires a value"
80+
GIT_REF=$2
81+
shift 2
82+
;;
83+
--output-dir)
84+
[[ $# -ge 2 ]] || fail "--output-dir requires a value"
85+
OUTPUT_DIR=$2
86+
shift 2
87+
;;
88+
--signing-key)
89+
[[ $# -ge 2 ]] || fail "--signing-key requires a value"
90+
SIGNING_KEY=$2
91+
shift 2
92+
;;
93+
-h|--help)
94+
usage
95+
exit 0
96+
;;
97+
*)
98+
fail "unknown argument: $1"
99+
;;
100+
esac
101+
done
102+
103+
[[ -n "${RELEASE_VERSION}" ]] || fail "--version is required"
104+
[[ -n "${GIT_REF}" ]] || fail "--git-ref is required"
105+
[[ "${RELEASE_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] ||
106+
fail "release version must use MAJOR.MINOR.PATCH format"
107+
108+
git -C "${SOURCE_ROOT}" rev-parse --verify "${GIT_REF}^{commit}" >/dev/null 2>&1 ||
109+
fail "Git ref does not resolve to a commit: ${GIT_REF}"
110+
111+
for required_file in CMakeLists.txt LICENSE NOTICE; do
112+
git -C "${SOURCE_ROOT}" cat-file -e "${GIT_REF}:${required_file}" 2>/dev/null ||
113+
fail "${required_file} is missing from ${GIT_REF}"
114+
done
115+
116+
CMAKE_VERSION=$(
117+
git -C "${SOURCE_ROOT}" show "${GIT_REF}:CMakeLists.txt" |
118+
sed -n 's/^[[:space:]]*VERSION[[:space:]]\+\([0-9][0-9.]*\).*$/\1/p' |
119+
head -n 1
120+
)
121+
[[ "${CMAKE_VERSION}" == "${RELEASE_VERSION}" ]] ||
122+
fail "CMake version ${CMAKE_VERSION:-<missing>} does not match ${RELEASE_VERSION}"
123+
124+
DOCS_VERSION=$(
125+
git -C "${SOURCE_ROOT}" show "${GIT_REF}:docs/source/conf.py" |
126+
sed -n 's/^version = "\([^"]*\)"$/\1/p' |
127+
head -n 1
128+
)
129+
[[ "${DOCS_VERSION}" == "${RELEASE_VERSION}" ]] ||
130+
fail "documentation version ${DOCS_VERSION:-<missing>} does not match ${RELEASE_VERSION}"
131+
132+
ARTIFACT_NAME="apache-paimon-cpp-${RELEASE_VERSION}-src.tgz"
133+
ARCHIVE_ROOT="paimon-cpp-${RELEASE_VERSION}"
134+
135+
mkdir -p "${OUTPUT_DIR}"
136+
OUTPUT_DIR=$(cd "${OUTPUT_DIR}" && pwd)
137+
138+
for suffix in "" ".sha512" ".asc"; do
139+
[[ ! -e "${OUTPUT_DIR}/${ARTIFACT_NAME}${suffix}" ]] ||
140+
fail "refusing to overwrite ${OUTPUT_DIR}/${ARTIFACT_NAME}${suffix}"
141+
done
142+
143+
TEMP_DIR=$(mktemp -d)
144+
trap 'rm -rf "${TEMP_DIR}"' EXIT
145+
146+
echo "Creating ${ARTIFACT_NAME} from ${GIT_REF}..."
147+
git -C "${SOURCE_ROOT}" -c tar.umask=0022 archive \
148+
--format=tar \
149+
--prefix="${ARCHIVE_ROOT}/" \
150+
"${GIT_REF}" |
151+
gzip -n >"${TEMP_DIR}/${ARTIFACT_NAME}"
152+
153+
SHA512=$(calculate_sha512 "${TEMP_DIR}/${ARTIFACT_NAME}")
154+
printf '%s %s\n' "${SHA512}" "${ARTIFACT_NAME}" \
155+
>"${TEMP_DIR}/${ARTIFACT_NAME}.sha512"
156+
157+
if [[ -n "${SIGNING_KEY}" ]]; then
158+
command -v gpg >/dev/null 2>&1 || fail "gpg is required to sign the artifact"
159+
echo "Signing ${ARTIFACT_NAME} with ${SIGNING_KEY}..."
160+
gpg --armor \
161+
--local-user "${SIGNING_KEY}" \
162+
--detach-sign \
163+
--output "${TEMP_DIR}/${ARTIFACT_NAME}.asc" \
164+
"${TEMP_DIR}/${ARTIFACT_NAME}"
165+
fi
166+
167+
mv "${TEMP_DIR}/${ARTIFACT_NAME}" "${OUTPUT_DIR}/"
168+
mv "${TEMP_DIR}/${ARTIFACT_NAME}.sha512" "${OUTPUT_DIR}/"
169+
if [[ -n "${SIGNING_KEY}" ]]; then
170+
mv "${TEMP_DIR}/${ARTIFACT_NAME}.asc" "${OUTPUT_DIR}/"
171+
fi
172+
173+
echo "Created release artifacts in ${OUTPUT_DIR}:"
174+
echo " ${ARTIFACT_NAME}"
175+
echo " ${ARTIFACT_NAME}.sha512"
176+
if [[ -n "${SIGNING_KEY}" ]]; then
177+
echo " ${ARTIFACT_NAME}.asc"
178+
else
179+
echo " Signature not created; pass --signing-key for an official release candidate."
180+
fi

0 commit comments

Comments
 (0)