This is an automated email from the ASF dual-hosted git repository.
frankgh pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-sidecar.git
The following commit(s) were added to refs/heads/trunk by this push:
new 7a088dde5 CASSSIDECAR-412: Generate distribution checksums (#324)
7a088dde5 is described below
commit 7a088dde50d7ad906e21c021b1b901a56baf0d84
Author: Francisco Guerrero <[email protected]>
AuthorDate: Sun Mar 1 09:28:48 2026 -0800
CASSSIDECAR-412: Generate distribution checksums (#324)
Patch by Francisco Guerrero; reviewed by Bernardo Botella for
CASSSIDECAR-412
---
build.gradle | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/build.gradle b/build.gradle
index 372869eb3..5e5ef406b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -443,3 +443,54 @@ signing {
sign buildDeb
sign buildRpm
}
+
+// Generate SHA-256 and SHA-512 checksums for distribution artifacts
+// Required for Apache releases
+tasks.register('generateDistributionChecksums') {
+ description = 'Generates SHA-256 and SHA-512 checksums for distribution
artifacts'
+ group = 'distribution'
+
+ dependsOn distTar, distZip, sourcesDistTar, sourcesDistZip
+
+ doLast {
+ println "Generating checksums for distribution archives..."
+ [distTar, distZip, sourcesDistTar, sourcesDistZip].each { task ->
+ def archive = task.archiveFile.get().asFile
+
+ if (archive.exists()) {
+ // Generate SHA-256 checksum
+ def sha256File = new File("${archive}.sha256")
+ def sha256 = java.security.MessageDigest.getInstance("SHA-256")
+ archive.withInputStream { is ->
+ def buffer = new byte[8192]
+ int read
+ while ((read = is.read(buffer)) != -1) {
+ sha256.update(buffer, 0, read)
+ }
+ }
+ sha256File.text = sha256.digest().encodeHex().toString() + "
" + archive.name
+
+ // Generate SHA-512 checksum
+ def sha512File = new File("${archive}.sha512")
+ def sha512 = java.security.MessageDigest.getInstance("SHA-512")
+ archive.withInputStream { is ->
+ def buffer = new byte[8192]
+ int read
+ while ((read = is.read(buffer)) != -1) {
+ sha512.update(buffer, 0, read)
+ }
+ }
+ sha512File.text = sha512.digest().encodeHex().toString() + "
" + archive.name
+ } else {
+ println " ✗ Archive not found: ${archive.absolutePath}"
+ }
+ }
+ }
+}
+
+distTar.finalizedBy generateDistributionChecksums
+distZip.finalizedBy generateDistributionChecksums
+sourcesDistTar.finalizedBy generateDistributionChecksums
+sourcesDistZip.finalizedBy generateDistributionChecksums
+assembleDist.finalizedBy generateDistributionChecksums
+assembleSourcesDist.finalizedBy generateDistributionChecksums
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]