This is an automated email from the ASF dual-hosted git repository.
MartijnVisser pushed a commit to branch release_utils
in repository
https://gitbox.apache.org/repos/asf/flink-connector-shared-utils.git
The following commit(s) were added to refs/heads/release_utils by this push:
new b9ea621 [FLINK-41155] Add stage_source_release_atr.sh for Apache
Trusted Releases (#63)
b9ea621 is described below
commit b9ea6215f1dea08b21e552e6553e8a49ff567361
Author: Martijn Visser <[email protected]>
AuthorDate: Mon Oct 26 15:59:18 2026 +0100
[FLINK-41155] Add stage_source_release_atr.sh for Apache Trusted Releases
(#63)
- Move create_source_release to _utils.sh, no behaviour change
- Add stage_source_release_atr.sh: builds the source release like
stage_source_release.sh and uploads it with rsync to the release's
draft in ATR; refuses macOS's openrsync, which ATR rejects
- Clear the artifacts directory before building, so a rerun after a
failed upload starts clean
- README: document the script; ATR publishes to dist/release itself
Generated-by: Claude Code (Claude Opus 5.5)
---
README.md | 18 +++++++++++++--
_utils.sh | 36 ++++++++++++++++++++++++++++-
stage_source_release.sh | 32 --------------------------
stage_source_release_atr.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 106 insertions(+), 35 deletions(-)
diff --git a/README.md b/README.md
index b4694ad..1186723 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,20 @@ The project name is automatically determined from the
repository name, but can b
The version is automatically determined from the version in the pom.
The created `svn` directory will contain a `-rc${RC_NUM}` suffix.
+## stage_source_release_atr.sh
+
+Creates the same source release as `stage_source_release.sh`, but uploads it
with `rsync` to the draft of the release
+on [Apache Trusted Releases](https://releases.apache.org) (ATR) instead of
committing it to `svn`.
+The draft must exist before the upload, created with "Start a new release" for
version `${version}` in ATR, and
+your SSH public key must be added to ATR.
+`${ATR_UID}` is your Apache user id. The ATR project key must match the
project name.
+The draft has no `-rc${RC_NUM}` suffix: each upload creates a new revision of
the same ATR release.
+ATR rejects the `openrsync` that macOS ships as `rsync`; install rsync, for
example with `brew install rsync`.
+
+```
+ATR_UID=<apache id> ./stage_source_release_atr.sh
+```
+
## stage_jars.sh
Creates the jars from the current branch and deploys them to
[repository.apache.org](https://repository.apache.org).
@@ -83,12 +97,12 @@ additionally be called on the `main` branch.
3. checkout a specific commit to create a release from
4. run `check_environment.sh`
5. run `update_branch_version.sh`
-6. run `stage_source_release.sh`
+6. run `stage_source_release.sh`, or `stage_source_release_atr.sh` when
releasing with ATR
7. run `stage_jars.sh` (once for each supported Flink version)
8. run `release_git_tag.sh` (with `RC_NUM`)
9. vote on release
10. finalize release or cancel and go back to step 2
-11. run `release_source_release.sh`
+11. run `release_source_release.sh`, unless the release was made with ATR,
which publishes it to the release directory itself
12. run `release_git_tag.sh` (without `RC_NUM`)
13. run `update_japicmp_configuration.sh` (on snapshot branch, and maybe
`main`)
diff --git a/_utils.sh b/_utils.sh
index b85470b..cad4f31 100644
--- a/_utils.sh
+++ b/_utils.sh
@@ -93,4 +93,38 @@ function is_flink_version_set_in_pom {
echo "Unexpected flink.version '${version}'." >&2
exit 1
fi
-}
\ No newline at end of file
+}
+
+function create_source_release {
+ cd ${SOURCE_DIR}
+ mkdir -p ${RELEASE_DIR}
+ # files left by a failed run would stop gpg at the existing .asc and be
uploaded again
+ rm -rf ${ARTIFACTS_DIR}
+ mkdir -p ${ARTIFACTS_DIR}
+
+ project=${PROJECT:-${PWD##*/}}
+ version=$(get_pom_version)
+ if [[ ${version} =~ -SNAPSHOT$ ]]; then
+ echo "Source releases should not be created for SNAPSHOT versions. Use
'update_branch_version.sh' first."
+ exit 1
+ fi
+
+ echo "Creating source release v${version}"
+ echo "To revert this step, run 'rm ${ARTIFACTS_DIR}'"
+
+ clone_dir=$(create_pristine_source "${SOURCE_DIR}" "${RELEASE_DIR}")
+ versioned_dir="${ARTIFACTS_DIR}/${project}-${version}"
+ mv ${clone_dir} ${versioned_dir}
+
+ cd "${ARTIFACTS_DIR}"
+ # macOS's bsdtar otherwise adds AppleDouble ._* files and extended
attributes; busybox tar has no --no-xattrs
+ tar_options=""
+ case "$(tar --version 2>/dev/null)" in
+ *bsdtar*) tar_options="--no-xattrs" ;;
+ esac
+ COPYFILE_DISABLE=1 tar ${tar_options} -czf
${ARTIFACTS_DIR}/${project}-${version}-src.tgz ${versioned_dir##*/}
+ gpg --armor --detach-sig ${ARTIFACTS_DIR}/${project}-${version}-src.tgz
+ ${SHASUM} ${project}-${version}-src.tgz >${project}-${version}-src.tgz.sha512
+
+ rm -rf ${versioned_dir}
+}
diff --git a/stage_source_release.sh b/stage_source_release.sh
index 4c3d614..4819a42 100755
--- a/stage_source_release.sh
+++ b/stage_source_release.sh
@@ -28,38 +28,6 @@ check_variables_set RC_NUM
###########################
-function create_source_release {
- cd ${SOURCE_DIR}
- mkdir -p ${RELEASE_DIR}
- mkdir -p ${ARTIFACTS_DIR}
-
- project=${PROJECT:-${PWD##*/}}
- version=$(get_pom_version)
- if [[ ${version} =~ -SNAPSHOT$ ]]; then
- echo "Source releases should not be created for SNAPSHOT versions. Use
'update_branch_version.sh' first."
- exit 1
- fi
-
- echo "Creating source release v${version}"
- echo "To revert this step, run 'rm ${ARTIFACTS_DIR}'"
-
- clone_dir=$(create_pristine_source "${SOURCE_DIR}" "${RELEASE_DIR}")
- versioned_dir="${ARTIFACTS_DIR}/${project}-${version}"
- mv ${clone_dir} ${versioned_dir}
-
- cd "${ARTIFACTS_DIR}"
- # macOS's bsdtar otherwise adds AppleDouble ._* files and extended
attributes; busybox tar has no --no-xattrs
- tar_options=""
- case "$(tar --version 2>/dev/null)" in
- *bsdtar*) tar_options="--no-xattrs" ;;
- esac
- COPYFILE_DISABLE=1 tar ${tar_options} -czf
${ARTIFACTS_DIR}/${project}-${version}-src.tgz ${versioned_dir##*/}
- gpg --armor --detach-sig ${ARTIFACTS_DIR}/${project}-${version}-src.tgz
- ${SHASUM} ${project}-${version}-src.tgz >${project}-${version}-src.tgz.sha512
-
- rm -rf ${versioned_dir}
-}
-
function deploy_source_release {
cd ${SOURCE_DIR}
project=${PROJECT:-${PWD##*/}}
diff --git a/stage_source_release_atr.sh b/stage_source_release_atr.sh
new file mode 100755
index 0000000..390e702
--- /dev/null
+++ b/stage_source_release_atr.sh
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+
+SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
+
+source "${SCRIPT_DIR}/_init.sh"
+source "${SCRIPT_DIR}/_utils.sh"
+
+###########################
+
+check_variables_set ATR_UID
+
+ATR_HOST=${ATR_HOST:-releases.apache.org}
+
+###########################
+
+function check_rsync {
+ # ATR rejects the arguments that macOS's built-in openrsync sends
+ if rsync --version 2>&1 | grep -q openrsync; then
+ echo "openrsync is not supported by ATR. Install rsync, for example with
'brew install rsync'."
+ exit 1
+ fi
+}
+
+function upload_source_release {
+ cd ${SOURCE_DIR}
+ project=${PROJECT:-${PWD##*/}}
+ version=$(get_pom_version)
+
+ echo "Uploading source release v${version} to the ${project} ${version}
draft on ${ATR_HOST}"
+ echo "To revert this step, delete the files on the release's Compose page on
https://${ATR_HOST}"
+
+ rsync -av -e 'ssh -p 2222' "${ARTIFACTS_DIR}/"
"${ATR_UID}@${ATR_HOST}:/${project}/${version}/"
+
+ rm -rf ${ARTIFACTS_DIR}
+}
+
+(check_rsync)
+(create_source_release)
+(upload_source_release)