From 220c30292166725ecef9c393c7d7c7043a2bf493 Mon Sep 17 00:00:00 2001 From: Richard Eckart de Castilho Date: Sat, 25 Jul 2026 18:01:50 +0200 Subject: [PATCH 1/4] #6189 - Release helper script - Initial version with a status command --- scripts/release.sh | 289 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100755 scripts/release.sh diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 0000000000..41928f4f99 --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,289 @@ +#!/usr/bin/env bash +# +# Licensed to the Technische Universität Darmstadt under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The Technische Universität Darmstadt +# 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. +# +# 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 helper. Every subcommand is independently invocable and safe to +# re-run: state is derived by looking at the file system and at the GitHub +# release, never from a state file. That way you can stop after any step, +# continue days later, and steps you performed by hand are still recognized. +# +# Usage: +# release.sh status +# +# See `release.sh --help`. + +set -euo pipefail + +# --------------------------------------------------------------------------- +# Configuration +# --------------------------------------------------------------------------- + +REPO="inception-project/inception" + +# Resolve the project root from this script's location so the script works +# regardless of the current working directory. +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd -- "$SCRIPT_DIR/.." && pwd)" + +MACOS_TARGET="$PROJECT_ROOT/inception/inception-dist-macos/target" +WIN_TARGET="$PROJECT_ROOT/inception/inception-dist-win/target" +WEBAPP_TARGET="$PROJECT_ROOT/inception/inception-app-webapp/target" + +# --------------------------------------------------------------------------- +# Output helpers +# --------------------------------------------------------------------------- + +if [ -t 1 ]; then + C_RESET=$'\033[0m'; C_BOLD=$'\033[1m'; C_DIM=$'\033[2m' + C_GREEN=$'\033[32m'; C_YELLOW=$'\033[33m'; C_RED=$'\033[31m' +else + C_RESET=''; C_BOLD=''; C_DIM=''; C_GREEN=''; C_YELLOW=''; C_RED='' +fi + +say() { printf '%s\n' "$*"; } +warn() { printf '%s\n' "${C_YELLOW}WARNING:${C_RESET} $*" >&2; } +die() { printf '%s\n' "${C_RED}ERROR:${C_RESET} $*" >&2; exit 1; } + +# Status markers. Deliberately ASCII-safe words rather than symbols only, so +# the output stays readable when redirected to a file or a CI log. +mark_ok() { printf ' %sok%s %s\n' "$C_GREEN" "$C_RESET" "$*"; } +mark_missing() { printf ' %smissing%s %s\n' "$C_YELLOW" "$C_RESET" "$*"; } +mark_note() { printf ' %s-%s %s\n' "$C_DIM" "$C_RESET" "$*"; } + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + +require_tool() { + command -v "$1" >/dev/null 2>&1 || die "Required tool '$1' not found in PATH." +} + +# Print the size of a file in a human readable form, or nothing if absent. +file_size() { + if [ -f "$1" ]; then + du -h "$1" | awk '{print $1}' + fi +} + +# The git tag used for a given version. +tag_for() { printf 'inception-%s\n' "$1"; } + +# Native installers are named after the base version *without* any beta +# suffix, e.g. the inception-41.0-beta-2 release contains +# INCEpTION-41.0-x86_64.msi, while the JAR keeps the full version. +base_version_for() { printf '%s\n' "${1%%-beta*}"; } + +# --------------------------------------------------------------------------- +# Expected artifacts +# --------------------------------------------------------------------------- + +# Emits "