Skip to content

Commit e0a261d

Browse files
jonnybot0Carl Marcum
andcommitted
Update Release notes to use verification scripts
Co-Authored-By: Carl Marcum <cmarcum@apache.org>
1 parent 74e1131 commit e0a261d

6 files changed

Lines changed: 405 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ out
1212
*.hprof
1313
.pnpm-store/
1414
**/tags
15+
etc/bin/results

RELEASING.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ limitations under the License.
4444
11. `git push` the version branch and tag to GitHub
4545
12. `read -s APACHE_PW` and enter your password at the prompt
4646
13. Run `./gradlew --no-build-cache publishJarsAndManual -x :integration:geb-gradle:publishPlugins -PapacheUser=jonnybot -PapachePassword="${APACHE_PW}"`
47-
14. Start the vote process on the groovy-dev mailing list. It will need at least 72 hours of remaining open and receive at least three affirmative votes from the Groovy PMC. See the [Apache Voting process](https://www.apache.org/foundation/voting.html) for more detail. Mention significant breaking changes if there are any.
48-
15. Assuming the vote passes (at least three +1 votes from the PMC), you can take the following steps to finalize the release.
49-
16. Email the vote thread to note that the vote has passed, with a final tally of the votes.
50-
17. Ask a member of the PMC to copy the artifacts from the staging directory in subversion to `groovy-release/geb/${VERSION}` and commit them to subversion, as above.
51-
18. Ask a member of the PMC to release the staging repository at https://repository.apache.org/#stagingRepositories
52-
19. Release the Gradle plugins with `./gradlew :integration:geb-gradle:publishPlugins`
47+
14. Verify the staged release. Run the automated verification script from the project root:
48+
```bash
49+
etc/bin/verify.sh dev «version» /tmp/geb-«version»-verify
50+
```
51+
This downloads the staged artifacts, verifies checksums and GPG signatures, checks for required files, and runs the RAT license audit. The individual scripts in `etc/bin/` can also be run separately — see their header comments for details.
52+
15. Verify the build is reproducible per [ASF Security policy](https://cwiki.apache.org/confluence/display/SECURITY/Reproducible+Builds) by running `etc/bin/test-reproducible-builds.sh`; this will run the build twice to ensure that the built outputs are identical.
53+
16. Start the vote process on the groovy-dev mailing list. It will need at least 72 hours of remaining open and receive at least three affirmative votes from the Groovy PMC. See the [Apache Voting process](https://www.apache.org/foundation/voting.html) for more detail. Mention significant breaking changes if there are any.
54+
17. Assuming the vote passes (at least three +1 votes from the PMC), you can take the following steps to finalize the release.
55+
18. Email the vote thread to note that the vote has passed, with a final tally of the votes.
56+
19. Ask a member of the PMC to copy the artifacts from the staging directory in subversion to `groovy-release/geb/${VERSION}` and commit them to subversion, as above.
57+
20. Ask a member of the PMC to release the staging repository at https://repository.apache.org/#stagingRepositories
58+
21. Release the Gradle plugins with `./gradlew :integration:geb-gradle:publishPlugins`
5359

5460
# Post-release actions
5561
1. Bump the version to a snapshot of the next planned version.
@@ -58,11 +64,11 @@ limitations under the License.
5864
4. Commit with message 'Begin version «version»'
5965
5. Push (make sure you push the tag as well).
6066
6. Merge the release branch back into the master branch.
61-
6. Bump Geb versions in example projects:
67+
6. Bump Geb versions in example projects:
6268
* [geb-example-gradle](https://github.com/geb/geb-example-gradle)
6369
* [geb-example-maven](https://github.com/geb/geb-example-maven)
6470
7. Update issues and milestones in GitHub tracker:
6571
* Find all unresolved issues in the tracker that have the fix version set to the recently released version and bulk edit them to have the fix version set to the next version.
6672
* Find the recently released milestone, change the version number if it's different from the one that was released and close it.
6773
8. Wait for the build of the next version to pass and the site including manual for the released version to be published.
68-
9. Send an email to the mailing list announcing the release. You can use [this one]() as a template.
74+
9. Send an email to the mailing list announcing the release. You can use [this one]() as a template.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
# https://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+
#
21+
# download-release-artifacts.sh - Download Geb release artifacts from dist.apache.org.
22+
#
23+
# Fetches the source distribution zip, its GPG signature (.asc), and checksum
24+
# files (.sha256, .sha512) into a local directory for offline verification.
25+
#
26+
# Artifacts are downloaded from:
27+
# https://dist.apache.org/repos/dist/{dev|release}/groovy/geb/<version>/
28+
#
29+
# Usage:
30+
# download-release-artifacts.sh <dev|release> <version> [download-dir]
31+
#
32+
33+
set -euo pipefail
34+
35+
if [ $# -lt 2 ]; then
36+
echo "Usage: $0 ['dev' or 'release'] [semantic.version] <optional download location>"
37+
exit 1
38+
fi
39+
40+
PROJECT_NAME='groovy-geb'
41+
DIST_TYPE=$1
42+
VERSION=$2
43+
DOWNLOAD_LOCATION="${3:-downloads}"
44+
45+
if [[ "${DIST_TYPE}" != "dev" && "${DIST_TYPE}" != "release" ]]; then
46+
echo "Error: DIST_TYPE must be either 'dev' or 'release', got '${DIST_TYPE}'"
47+
echo "Usage: $0 ['dev' or 'release'] [version] <optional download location>"
48+
exit 1
49+
fi
50+
51+
VERSION=${VERSION#v} # in case someone prefixes a v
52+
53+
echo "Downloading files to ${DOWNLOAD_LOCATION}"
54+
mkdir -p "${DOWNLOAD_LOCATION}/src"
55+
56+
# Geb publishes a source distribution under the groovy dist area
57+
BASE_URL="https://dist.apache.org/repos/dist/${DIST_TYPE}/groovy/geb/${VERSION}"
58+
59+
echo "Downloading source release files from ${BASE_URL} ..."
60+
curl -f -L -o "${DOWNLOAD_LOCATION}/src/apache-${PROJECT_NAME}-src-${VERSION}.zip" \
61+
"${BASE_URL}/apache-${PROJECT_NAME}-src-${VERSION}.zip"
62+
curl -f -L -o "${DOWNLOAD_LOCATION}/src/apache-${PROJECT_NAME}-src-${VERSION}.zip.asc" \
63+
"${BASE_URL}/apache-${PROJECT_NAME}-src-${VERSION}.zip.asc"
64+
curl -f -L -o "${DOWNLOAD_LOCATION}/src/apache-${PROJECT_NAME}-src-${VERSION}.zip.sha256" \
65+
"${BASE_URL}/apache-${PROJECT_NAME}-src-${VERSION}.zip.sha256"
66+
curl -f -L -o "${DOWNLOAD_LOCATION}/src/apache-${PROJECT_NAME}-src-${VERSION}.zip.sha512" \
67+
"${BASE_URL}/apache-${PROJECT_NAME}-src-${VERSION}.zip.sha512"
68+
69+
echo "✅ Source release artifacts downloaded to ${DOWNLOAD_LOCATION}/src"
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
# https://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+
#
21+
# test-reproducible-builds.sh - Verify that the Geb build is reproducible.
22+
#
23+
# Required by ASF Security policy for projects that build/sign on CI:
24+
# https://cwiki.apache.org/confluence/display/SECURITY/Reproducible+Builds
25+
#
26+
# Builds all jar artifacts twice from a clean state and compares SHA-256
27+
# checksums. SOURCE_DATE_EPOCH is set from the last git commit to ensure
28+
# timestamp-dependent outputs are deterministic.
29+
#
30+
# Any differing jars are preserved under etc/bin/results/ for inspection.
31+
# That directory is git-ignored.
32+
#
33+
# Must be run from within a Geb git checkout. Takes no arguments.
34+
#
35+
# Usage:
36+
# etc/bin/test-reproducible-builds.sh
37+
#
38+
39+
set -euo pipefail
40+
41+
export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)
42+
43+
CWD=$(pwd)
44+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
45+
cd "${SCRIPT_DIR}/../.."
46+
47+
rm -rf "${SCRIPT_DIR}/results" || true
48+
mkdir -p "${SCRIPT_DIR}/results/first"
49+
mkdir -p "${SCRIPT_DIR}/results/second"
50+
51+
echo "================================================================"
52+
echo " Testing Reproducible Builds for Apache Groovy Geb"
53+
echo " SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH}"
54+
echo "================================================================"
55+
echo ""
56+
57+
echo "Cleaning project..."
58+
git clean -xdf --exclude='etc/bin' --exclude='.idea' --exclude='.gradle'
59+
60+
echo ""
61+
echo "--- First build ---"
62+
./gradlew jar --rerun-tasks --no-build-cache
63+
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | while IFS= read -r -d '' f; do
64+
shasum -a 256 "$f"
65+
done | sort > "${SCRIPT_DIR}/results/first.txt"
66+
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | xargs -0 -I{} cp --parents {} "${SCRIPT_DIR}/results/first/" 2>/dev/null || \
67+
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | while IFS= read -r -d '' f; do
68+
mkdir -p "${SCRIPT_DIR}/results/first/$(dirname "$f")"
69+
cp "$f" "${SCRIPT_DIR}/results/first/$f"
70+
done
71+
72+
echo ""
73+
echo "--- Cleaning for second build ---"
74+
git clean -xdf --exclude='etc/bin' --exclude='.idea' --exclude='.gradle'
75+
76+
echo ""
77+
echo "--- Second build ---"
78+
./gradlew jar --rerun-tasks --no-build-cache
79+
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | while IFS= read -r -d '' f; do
80+
shasum -a 256 "$f"
81+
done | sort > "${SCRIPT_DIR}/results/second.txt"
82+
find . -path ./etc -prune -o -type f -path '*/build/libs/*.jar' -print0 | while IFS= read -r -d '' f; do
83+
mkdir -p "${SCRIPT_DIR}/results/second/$(dirname "$f")"
84+
cp "$f" "${SCRIPT_DIR}/results/second/$f"
85+
done
86+
87+
echo ""
88+
echo "--- Comparing builds ---"
89+
cd "${SCRIPT_DIR}/results"
90+
if diff -u first.txt second.txt > diff.txt 2>&1; then
91+
echo "✅ All jar artifacts are identical between the two builds."
92+
rm -f diff.txt
93+
else
94+
echo "❌ Some jar artifacts differ between builds:"
95+
cat diff.txt
96+
echo ""
97+
echo "Differing artifacts have been preserved in:"
98+
echo " ${SCRIPT_DIR}/results/first/"
99+
echo " ${SCRIPT_DIR}/results/second/"
100+
fi
101+
102+
cd "$CWD"
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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+
# https://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+
#
21+
# verify-source-distribution.sh - Verify a downloaded Geb source distribution.
22+
#
23+
# Expects the download directory to contain SVN_KEYS (the Groovy project KEYS
24+
# file) and a src/ subdirectory with the zip, .asc, and .sha256 files, as
25+
# produced by download-release-artifacts.sh.
26+
#
27+
# Performs the following checks:
28+
# 1. SHA-256 checksum verification
29+
# 2. GPG signature verification (using an isolated temporary keyring)
30+
# 3. Extraction and presence of LICENSE, NOTICE, and README.md
31+
#
32+
# Usage:
33+
# verify-source-distribution.sh <version> [download-dir]
34+
#
35+
36+
set -euo pipefail
37+
38+
if [ $# -lt 1 ]; then
39+
echo "Usage: $0 [semantic.version] <optional download location>"
40+
exit 1
41+
fi
42+
43+
VERSION=$1
44+
DOWNLOAD_LOCATION="$(cd "${2:-downloads}" && pwd)"
45+
46+
VERSION=${VERSION#v} # in case someone prefixes a v
47+
48+
cd "${DOWNLOAD_LOCATION}/src"
49+
ZIP_FILE="apache-groovy-geb-src-${VERSION}.zip"
50+
51+
if [ ! -f "${ZIP_FILE}" ]; then
52+
echo "Error: Could not find ${ZIP_FILE} in ${DOWNLOAD_LOCATION}/src"
53+
exit 1
54+
fi
55+
56+
export GEB_GPG_HOME=$(mktemp -d)
57+
cleanup() {
58+
rm -rf "${GEB_GPG_HOME}"
59+
}
60+
trap cleanup EXIT
61+
62+
echo "Verifying SHA-256 checksum..."
63+
EXPECTED_HASH=$(cat "${ZIP_FILE}.sha256" | awk '{print $1}' | tr -d '\r\n')
64+
ACTUAL_HASH=$(shasum -a 256 "${ZIP_FILE}" | awk '{print $1}')
65+
if [ "${EXPECTED_HASH}" != "${ACTUAL_HASH}" ]; then
66+
echo "❌ SHA-256 checksum verification failed"
67+
echo " Expected: ${EXPECTED_HASH}"
68+
echo " Actual: ${ACTUAL_HASH}"
69+
exit 1
70+
fi
71+
echo "✅ SHA-256 Checksum Verified"
72+
73+
echo "Importing GPG keys to independent GPG home ..."
74+
gpg --homedir "${GEB_GPG_HOME}" --import "${DOWNLOAD_LOCATION}/SVN_KEYS"
75+
echo "✅ GPG Keys Imported"
76+
77+
echo "Verifying GPG signature..."
78+
gpg --homedir "${GEB_GPG_HOME}" --verify "${ZIP_FILE}.asc" "${ZIP_FILE}"
79+
echo "✅ GPG Signature Verified"
80+
81+
SRC_DIR="groovy-geb-${VERSION}"
82+
83+
if [ -d "${SRC_DIR}" ]; then
84+
echo "Previous source directory found, removing..."
85+
rm -rf "${SRC_DIR}"
86+
fi
87+
88+
echo "Extracting zip file..."
89+
unzip -q "${ZIP_FILE}"
90+
91+
if [ ! -d "${SRC_DIR}" ]; then
92+
echo "Error: Expected extracted folder '${SRC_DIR}' not found."
93+
exit 1
94+
fi
95+
96+
echo "Checking for required files..."
97+
REQUIRED_FILES=("LICENSE" "NOTICE" "README.md")
98+
99+
for FILE in "${REQUIRED_FILES[@]}"; do
100+
if [ ! -f "${SRC_DIR}/${FILE}" ]; then
101+
echo "❌ Missing required file: ${FILE}"
102+
exit 1
103+
fi
104+
echo "✅ Found required file: ${FILE}"
105+
done
106+
107+
echo "✅ All source distribution checks passed for Apache Groovy Geb ${VERSION}."

0 commit comments

Comments
 (0)