Skip to content
Merged
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
133 changes: 133 additions & 0 deletions .github/workflows/rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# 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: RC
on:
push:
tags:
- '*-rc*'

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read

jobs:
archive:
name: Archive
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Prepare for tag
if: github.ref_type == 'tag'
run: |
version=${GITHUB_REF_NAME#v}
version=${version%-rc*}
rc=${GITHUB_REF_NAME##*-rc}
echo "VERSION=${version}" >> ${GITHUB_ENV}
echo "RC=${rc}" >> ${GITHUB_ENV}
echo "VERSION=${version}"
echo "RC=${rc}"

- name: Archive
run: |
ARCHIVE_FILE_NAME="apache-iceberg-cpp-${VERSION}-rc${RC}"
tar_gz="${ARCHIVE_FILE_NAME}.tar.gz"
echo "TAR_GZ=${tar_gz}" >> ${GITHUB_ENV}
git archive HEAD --prefix "${ARCHIVE_FILE_NAME}/" --output "${tar_gz}"
sha512sum "${tar_gz}" > "${tar_gz}.sha512"

- name: Audit
run: |
dev/release/run_rat.sh "${TAR_GZ}"

- uses: actions/upload-artifact@v4
with:
name: archive
path: |
apache-iceberg-cpp-*

verify:
name: Verify
needs:
- archive
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-15
- ubuntu-24.04
# - windows-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/download-artifact@v4
with:
name: archive

- name: Verify
run: |
tar_gz=$(echo apache-iceberg-cpp-*.tar.gz)
version=${tar_gz#apache-iceberg-cpp-}
version=${version%.tar.gz}
version=${version%%-rc*}
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
rc=${GITHUB_REF_NAME##*-rc}
else
rc=100
fi
echo "VERSION=${version}"
echo "RC=${rc}"
# The verify_rc.sh script will untar and
# run cmake, build, tests (ctest) and install
VERIFY_SIGN=0 VERIFY_DOWNLOAD=0 dev/release/verify_rc.sh "${version}" "${rc}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

upload:
name: Upload
if: github.ref_type == 'tag'
needs:
- verify
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/download-artifact@v4
with:
name: archive

- name: Upload
run: |
gh release create ${GITHUB_REF_NAME} \
--prerelease \
--title "Apache Iceberg C++ ${GITHUB_REF_NAME}" \
--generate-notes \
--verify-tag \
apache-iceberg-cpp-*.tar.gz \
apache-iceberg-cpp-*.tar.gz.sha*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110 changes: 110 additions & 0 deletions dev/release/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<!--
~ 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.
-->

# Release

## Overview

1. Test the revision to be released
2. Prepare RC and vote (detailed later)
3. Publish (detailed later)

### Prepare RC and vote

Run `dev/release/release_rc.sh` on a working copy of
`[email protected]:apache/iceberg-cpp` not from your fork:

```console
$ git clone [email protected]:apache/iceberg-cpp.git && cd iceberg-cpp
$ dev/release/release_rc.sh ${VERSION} ${RC}
(Send a vote email to [email protected].
You can use a draft shown by release_rc.sh for the email.)
```

Here is an example to release RC0 of version 0.1.0:

```console
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release_rc.sh 0.1.0 0
```

The arguments of `release_rc.sh` are the version and the RC number. If RC0 has a problem, we'll increment the RC number such as RC1, RC2 and so on.

Requirements to run `release_rc.sh`:

* You must be an Apache Iceberg committer or PMC member
* You must prepare your PGP key for signing

If you don't have a PGP key, https://infra.apache.org/release-signing.html#generate
may be helpful.

Your PGP key must be published in the KEYS file, which is hosted at:

* https://downloads.apache.org/iceberg/KEYS

See the header comment of them for how to add a PGP key.

If you are a first-time release manager, you need to add your public key to this file. To prevent formatting errors, please use the following commands instead of editing the file manually:

+ Check out the release distribution directory:

```console
$ svn co https://dist.apache.org/repos/dist/release/iceberg
$ cd iceberg
```
+ Append your GPG public key to the KEYS file. Replace <YOUR_KEY_ID> with your actual GPG key ID.

```console
$ echo "" >> KEYS # append a newline
$ gpg --list-sigs <YOUR_KEY_ID> >> KEYS # append signatures
$ gpg --armor --export <YOUR_KEY_ID> >> KEYS # append public key block
$ svn commit -m "Add GPG key for <YOUR_NAME>"
```

### Publish

We need to publish to apache.org to publish a new release.

Run `dev/release/release.sh` to publish to apache.org:

```console
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh ${VERSION} ${RC}
```

Add the release to ASF's report database via [Apache Committee Report Helper](https://reporter.apache.org/addrelease.html?iceberg)

### Verify

We have a script for verifying a RC.

You must install the following to run the script:

* `curl`
* `gpg`
* `shasum` or `sha512sum`
* `tar`
* `cmake` (3.25 or higher)
* C++23 compliant compiler (GCC 13+ or Clang 16+)

To verify a RC, run the following:

```console
$ dev/release/verify_rc.sh ${VERSION} ${RC}
```

If the verification is successful, the message `RC looks good!` is shown.
65 changes: 65 additions & 0 deletions dev/release/check_rat_report.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env python3
#
# 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.

import fnmatch
import re
import sys
import xml.etree.ElementTree as ET

if len(sys.argv) != 3:
sys.stderr.write("Usage: %s exclude_globs.lst rat_report.xml\n" %
sys.argv[0])
sys.exit(1)

exclude_globs_filename = sys.argv[1]
xml_filename = sys.argv[2]

globs = []
with open(exclude_globs_filename, "r") as f:
for line in f:
stripped_line = line.strip()
if not stripped_line or stripped_line.startswith('#'):
continue
globs.append(stripped_line)

tree = ET.parse(xml_filename)
root = tree.getroot()
resources = root.findall('resource')

all_ok = True
for r in resources:
approvals = r.findall('license-approval')
if not approvals or approvals[0].attrib['name'] == 'true':
continue
clean_name = re.sub('^[^/]+/', '', r.attrib['name'])
excluded = False
for g in globs:
if fnmatch.fnmatch(clean_name, g):
excluded = True
break
if not excluded:
sys.stdout.write("NOT APPROVED: %s (%s): %s\n" % (
clean_name, r.attrib['name'], approvals[0].attrib['name']))
all_ok = False

if not all_ok:
sys.exit(1)

print('OK')
sys.exit(0)
28 changes: 28 additions & 0 deletions dev/release/rat_exclude_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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.

.gitignore
LICENSE
NOTICE
build/**
dist/**
.git/**
test/resources/**
*.avro
*.json
*.parquet
src/iceberg/util/murmurhash3_internal.*
Loading
Loading