From fa7f5e586fa292cf1991884389b8e578b4168445 Mon Sep 17 00:00:00 2001 From: "markus.block" Date: Sun, 22 Feb 2026 18:21:20 +0100 Subject: [PATCH] added release script and docs --- README.md | 33 +++++++++- VERSION | 1 + ...installationsarbeiten_LC_Esslingen_XFCE.sh | 15 ++--- release.sh | 66 +++++++++++++++++++ 4 files changed, 104 insertions(+), 11 deletions(-) create mode 100644 VERSION create mode 100755 release.sh diff --git a/README.md b/README.md index fe15e30..04d62a2 100644 --- a/README.md +++ b/README.md @@ -16,4 +16,35 @@ software to create a virtual machine with Linux Mint XFCE. Then, copy the script This allows you to test the script without affecting your main system. You can also make use of snapshot feature of the virtualization software to easily revert to a clean state after testing, e.g. state directly after Linux Mint installation, before running the post-installation script. -This way you can test the script multiple times without needing to reinstall Linux Mint each time. \ No newline at end of file +This way you can test the script multiple times without needing to reinstall Linux Mint each time. + +## Release Process + +This project uses a simple release process based on git tags. + +### Versioning +- Version is stored in `VERSION` file (format: v0, v1, v2, ...) +- Major version increments only (major-bugfix scheme) +- Script version is also stored in `SCRIPT_VERSION` variable within the main script to display version during script execution + +### Creating a Release +Run the release script from the repository root: +```bash +./release.sh +``` + +The script will: +1. Check for uncommitted local changes (exits if any exist) +2. Show current version and propose next version +3. Prompt for confirmation +4. Update VERSION file and SCRIPT_VERSION in the script +5. Create a git commit +6. Create an annotated tag +7. Prompt to push to origin (including tags) + +### Gitea Integration +When a tag is pushed to the remote, Gitea automatically creates a release from it. + +### Requirements +- Clean working tree (no uncommitted changes) +- Git remote configured (origin) \ No newline at end of file diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..cc40603 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v9 diff --git a/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh b/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh index e807060..eab30b8 100644 --- a/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh +++ b/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh @@ -1,12 +1,6 @@ #!/bin/bash - -# "Anderungs Historie -# Datum Version Name Änderung -# 2025-11-11 v6 MartinP mehr Erläuterungen reingeschrieben -# 2025-11-17 v7 Mark Simualtion Modus und 32Bit abfrage entfernt -# 2025-12-12 v8 MartinP Erläuterungen ergänzt und Typos entfernt -# +SCRIPT_VERSION="v9" bIsVlcInstalled=false @@ -26,9 +20,10 @@ question_answered_with_yes() { echo " -################################### -#### Nachinstallationsarbeiten #### -################################### +##################################### +#### Nachinstallationsarbeiten +#### Version: $SCRIPT_VERSION +##################################### #### Was tut dieses Skript? #### diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..e79b478 --- /dev/null +++ b/release.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +set -e + +if [ -n "$(git status --porcelain)" ]; then + echo "Error: You have uncommitted local changes." + echo "Please commit or stash them before releasing." + echo "" + echo "Uncommitted files:" + git status --short + exit 1 +fi + +VERSION_FILE="VERSION" +SCRIPT_FILE="post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh" + +if [ ! -f "$VERSION_FILE" ]; then + echo "Error: $VERSION_FILE not found" + exit 1 +fi + +CURRENT_VERSION=$(cat "$VERSION_FILE" | tr -d '\n') + +if [ ! -f "$SCRIPT_FILE" ]; then + echo "Error: $SCRIPT_FILE not found" + exit 1 +fi + +CURRENT_MAJOR=${CURRENT_VERSION#v} + +NEXT_VERSION=$((CURRENT_MAJOR + 1)) +NEXT_VERSION_STR="v$NEXT_VERSION" + +echo "Current version: $CURRENT_VERSION" +echo "Proposed version: $NEXT_VERSION_STR" +echo "" + +read -p "Confirm release version $NEXT_VERSION_STR? [y/N]: " confirm + +if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then + echo "Release aborted." + exit 0 +fi + +echo "$NEXT_VERSION_STR" > "$VERSION_FILE" + +sed -i.bak "s/^SCRIPT_VERSION=.*/SCRIPT_VERSION=\"$NEXT_VERSION_STR\"/" "$SCRIPT_FILE" +if [ -f "${SCRIPT_FILE}.bak" ]; then + rm "${SCRIPT_FILE}.bak" +fi + +git add "$VERSION_FILE" "$SCRIPT_FILE" +git commit -m "Release $NEXT_VERSION_STR" + +git tag -a "$NEXT_VERSION_STR" -m "Release $NEXT_VERSION_STR" + +echo "" +echo "Tag $NEXT_VERSION_STR created locally." +read -p "Push to origin (includes tags)? [y/N]: " push_confirm + +if [[ "$push_confirm" == "y" || "$push_confirm" == "Y" ]]; then + git push origin --tags + echo "Done! Gitea will create release from tag $NEXT_VERSION_STR" +else + echo "Release prepared locally. Push manually with: git push origin --tags" +fi