Skip to content

Commit 61d758d

Browse files
committed
chore: Add release automation infrastructure
1 parent 6bb3d2b commit 61d758d

File tree

7 files changed

+43
-59
lines changed

7 files changed

+43
-59
lines changed

.github/workflows/rc.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@
1818
name: RC
1919
on:
2020
push:
21-
branches:
22-
- '**'
23-
- '!dependabot/**'
2421
tags:
2522
- '*-rc*'
26-
pull_request:
2723

2824
concurrency:
2925
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
@@ -35,12 +31,11 @@ jobs:
3531
archive:
3632
name: Archive
3733
runs-on: ubuntu-latest
38-
timeout-minutes: 10 # C++ submodules might take longer
34+
timeout-minutes: 5 # Can be reduced as we are not checking out submodules
3935
steps:
40-
- name: Checkout with submodules
36+
- name: Checkout
4137
uses: actions/checkout@v4
42-
with:
43-
submodules: 'recursive' # CRITICAL for C++ projects with dependencies
38+
# No longer need 'with: { submodules: 'recursive' }'
4439

4540
- name: Prepare for tag
4641
if: github.ref_type == 'tag'
@@ -53,30 +48,17 @@ jobs:
5348
echo "VERSION=${version}"
5449
echo "RC=${rc}"
5550
56-
- name: Prepare for branch
57-
if: github.ref_type == 'branch'
58-
run: |
59-
# Extract version from a file like VERSION.txt or CMakeLists.txt for branches
60-
# For simplicity, we'll hardcode a dev version here.
61-
version="0.1.0-dev"
62-
rc=100
63-
echo "VERSION=${version}" >> ${GITHUB_ENV}
64-
echo "RC=${rc}" >> ${GITHUB_ENV}
65-
echo "VERSION=${version}"
66-
echo "RC=${rc}"
67-
6851
- name: Archive
6952
run: |
7053
id="apache-iceberg-cpp-${VERSION}-rc${RC}"
7154
tar_gz="${id}.tar.gz"
7255
echo "TAR_GZ=${tar_gz}" >> ${GITHUB_ENV}
73-
# Use tar instead of git archive to include submodules
74-
tar -czf "${tar_gz}" --transform "s,^./,${id}/," .
56+
# Reverted to the git archive command from the Go implementation
57+
git archive HEAD --prefix "${id}/" --output "${tar_gz}"
7558
sha512sum "${tar_gz}" > "${tar_gz}.sha512"
7659
7760
- name: Audit
7861
run: |
79-
# Make sure this script exists in your C++ repository
8062
dev/release/run_rat.sh "${TAR_GZ}"
8163
8264
- uses: actions/upload-artifact@v4

dev/release/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
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-
http://www.apache.org/licenses/LICENSE-2.0
10-
Unless required by applicable law or agreed to in writing,
11-
software distributed under the License is distributed on an
12-
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13-
KIND, either express or implied. See the License for the
14-
specific language governing permissions and limitations
15-
under the License.
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.
1618
-->
1719

1820
# Release

dev/release/check_rat_report.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
exclude_globs_filename = sys.argv[1]
3131
xml_filename = sys.argv[2]
3232

33-
globs = [line.strip() for line in open(exclude_globs_filename, "r")]
33+
globs = []
34+
with open(exclude_globs_filename, "r") as f:
35+
for line in f:
36+
stripped_line = line.strip()
37+
if not stripped_line or stripped_line.startswith('#'):
38+
continue
39+
globs.append(stripped_line)
3440

3541
tree = ET.parse(xml_filename)
3642
root = tree.getroot()

dev/release/rat_exclude_files.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,15 @@
1818
.gitignore
1919
LICENSE
2020
NOTICE
21-
CLAUDE.md
22-
README.md
2321
CONTRIBUTING.md
2422
CHANGELOG.md
25-
build/
26-
dist/
27-
.github/
28-
.git/
29-
cmake_modules/
30-
.cmake/
31-
.clang-format
32-
.clang-tidy
33-
.pre-commit-config.yaml
34-
CMakeUserPresets.json
35-
test/resources/
36-
cmake-format.py
23+
build/**
24+
dist/**
25+
.git/**
26+
cmake_modules/**
27+
.cmake/**
28+
test/resources/**
3729
*.avro
3830
*.json
3931
*.parquet
32+
src/iceberg/util/murmurhash3_internal.*

dev/release/release_rc.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ cd "${SOURCE_TOP_DIR}"
4949

5050
if [ "${RELEASE_PULL}" -gt 0 ] || [ "${RELEASE_PUSH_TAG}" -gt 0 ]; then
5151
git_origin_url="$(git remote get-url origin)"
52-
if [ "${git_origin_url}" != "[email protected]:HeartLinked/iceberg-cpp.git" ]; then
53-
echo "This script must be ran with working copy of HeartLinked/iceberg-cpp."
54-
# if [ "${git_origin_url}" != "[email protected]:apache/iceberg-cpp.git" ]; then
55-
# echo "This script must be ran with working copy of apache/iceberg-cpp."
52+
if [ "${git_origin_url}" != "[email protected]:apache/iceberg-cpp.git" ]; then
53+
echo "This script must be ran with working copy of apache/iceberg-cpp."
5654
echo "The origin's URL: ${git_origin_url}"
5755
exit 1
5856
fi
@@ -96,7 +94,6 @@ if [ "${RELEASE_SIGN}" -gt 0 ]; then
9694
echo "Found GitHub Actions workflow with ID: ${run_id}"
9795
gh run watch --repo "${repository}" --exit-status "${run_id}"
9896

99-
# Create release candidate directory structure
10097
mkdir -p "${id}"
10198

10299
echo "Downloading .tar.gz from GitHub Releases"

dev/release/verify_rc.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ test_source_distribution() {
171171
# Run tests
172172
ctest --test-dir build --output-on-failure --parallel $(nproc || sysctl -n hw.ncpu || echo 4)
173173

174-
echo "Build and test completed successfully!"
174+
# Install
175+
mkdir -p ./install_test
176+
cmake --install build --prefix ./install_test
177+
178+
echo "Build, test and install completed successfully!"
175179
}
176180

177181
setup_tmpdir "iceberg-cpp-${VERSION}-${RC}"
File renamed without changes.

0 commit comments

Comments
 (0)