You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by pi...@apache.org on 2025/04/06 16:48:52 UTC

(iggy) branch master updated: feat(server): add prepare release script (#1678)

This is an automated email from the ASF dual-hosted git repository.

piotr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new f5a1dd0d feat(server): add prepare release script (#1678)
f5a1dd0d is described below

commit f5a1dd0d9f290e8d24e9c70f0a0aefa3dec02408
Author: Piotr Gankiewicz <pi...@gmail.com>
AuthorDate: Sun Apr 6 18:48:48 2025 +0200

    feat(server): add prepare release script (#1678)
---
 .gitignore                     |   2 +
 scripts/prepare-release.sh     | 115 +++++++++++++++++++++++++++++++++++++++++
 sdk/src/topics/create_topic.rs |   2 +-
 sdk/src/topics/update_topic.rs |   2 +-
 4 files changed, 119 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 803ded12..f21d448c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,5 @@ bench_*
 /rust-clippy-results.sarif
 /performance_results*
 .env
+/iggy_release
+/iggy_release_tmp
\ No newline at end of file
diff --git a/scripts/prepare-release.sh b/scripts/prepare-release.sh
new file mode 100755
index 00000000..9557a85e
--- /dev/null
+++ b/scripts/prepare-release.sh
@@ -0,0 +1,115 @@
+#!/bin/bash
+
+#!/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.
+
+# This script is used to generate Cross.toml file for user which executes
+# this script. This is needed since Cross.toml build.dockerfile.build-args
+# section requires statically defined Docker build arguments and parameters
+# like current UID or GID must be entered (cannot be generated or fetched
+# during cross execution time).
+
+set -euo pipefail
+
+# Determine tar command based on OS
+TAR_CMD="tar"
+OS_NAME=$(uname)
+
+if [[ "$OS_NAME" == "Darwin" ]]; then
+  if command -v gtar >/dev/null 2>&1; then
+    TAR_CMD="gtar"
+  else
+    echo "❌ GNU tar (gtar) is required on macOS. Install it with: brew install gnu-tar"
+    exit 1
+  fi
+fi
+
+if [ "$(basename "$PWD")" == "scripts" ]; then
+  cd ..
+fi
+
+SRC_DIR="./"
+RELEASE_DIR="iggy_release"
+TEMP_DIR="iggy_release_tmp"
+
+rm -rf "$TEMP_DIR"
+rm -rf "$RELEASE_DIR"
+mkdir -p "$TEMP_DIR"
+mkdir -p "$RELEASE_DIR"
+
+FILES=(
+  "Cargo.lock"
+  "Cargo.toml"
+  "DEPENDENCIES.md"
+  "DISCLAIMER"
+  "Dockerfile"
+  "LICENSE"
+  "NOTICE"
+  "docker-compose.yml"
+  "justfile"
+)
+
+DIRS=(
+  "bench"
+  "certs"
+  "cli"
+  "configs"
+  "examples"
+  "integration"
+  "licenses"
+  "scripts"
+  "sdk"
+  "server"
+  "tools"
+)
+
+for file in "${FILES[@]}"; do
+  cp "$SRC_DIR/$file" "$TEMP_DIR/"
+done
+
+for dir in "${DIRS[@]}"; do
+  cp -r "$SRC_DIR/$dir" "$TEMP_DIR/"
+done
+
+VERSION=$(grep '^version' "$TEMP_DIR/server/Cargo.toml" | head -n 1 | cut -d '"' -f2)
+
+echo "Preparing release for version: $VERSION"
+
+ARCHIVE_NAME="iggy-${VERSION}-incubating-src.tar.gz"
+
+GZIP=-n "$TAR_CMD" --sort=name \
+             --mtime='UTC 2020-01-01' \
+             --owner=0 --group=0 --numeric-owner \
+             -czf "$ARCHIVE_NAME" -C "$TEMP_DIR" .
+
+CHECKSUM_FILE="${ARCHIVE_NAME}.sha512"
+sha512sum "$ARCHIVE_NAME" > "$CHECKSUM_FILE"
+
+rm -rf "$TEMP_DIR"
+
+echo "Release directory: $RELEASE_DIR"
+echo "SHA-512 checksum:"
+cat "$CHECKSUM_FILE"
+echo "✔ Archive created: $ARCHIVE_NAME"
+echo "✔ Checksum saved to: $CHECKSUM_FILE"
+
+mv "$ARCHIVE_NAME" "$RELEASE_DIR/"
+mv "$CHECKSUM_FILE" "$RELEASE_DIR/"
+
+
diff --git a/sdk/src/topics/create_topic.rs b/sdk/src/topics/create_topic.rs
index 14c7f07b..3dc89d08 100644
--- a/sdk/src/topics/create_topic.rs
+++ b/sdk/src/topics/create_topic.rs
@@ -38,7 +38,7 @@ use std::str::from_utf8;
 /// - `partitions_count` - number of partitions in the topic, max value is 1000.
 /// - `message_expiry` - message expiry, if `NeverExpire` then messages will never expire.
 /// - `max_topic_size` - maximum size of the topic, if `Unlimited` then topic size is unlimited.
-///                      Can't be lower than segment size in the config.
+///   Can't be lower than segment size in the config.
 /// - `replication_factor` - replication factor for the topic.
 /// - `name` - unique topic name, max length is 255 characters.
 #[derive(Debug, Serialize, Deserialize, PartialEq)]
diff --git a/sdk/src/topics/update_topic.rs b/sdk/src/topics/update_topic.rs
index 5e217f41..059f6da7 100644
--- a/sdk/src/topics/update_topic.rs
+++ b/sdk/src/topics/update_topic.rs
@@ -37,7 +37,7 @@ use std::str::from_utf8;
 /// - `topic_id` - unique topic ID (numeric or name).
 /// - `message_expiry` - message expiry, if `NeverExpire` then messages will never expire.
 /// - `max_topic_size` - maximum size of the topic in bytes, if `Unlimited` then topic size is unlimited.
-///                      Can't be lower than segment size in the config.
+///   Can't be lower than segment size in the config.
 /// - `replication_factor` - replication factor for the topic.
 /// - `name` - unique topic name, max length is 255 characters.
 #[derive(Debug, Serialize, Deserialize, PartialEq)]