From 1f6989a54fb251e2ed37eef58f4f42862a403f6d Mon Sep 17 00:00:00 2001 From: Fabian Franz Steiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:41:03 +0000 Subject: [PATCH 1/3] Refine version bump logic to apply changes only if Python files are modified, defaulting to patch bump otherwise --- .github/workflows/release.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c04827..6dc8063 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,22 +58,26 @@ jobs: run: | VERSION_INCREMENT="${{ steps.gitversion.outputs.MajorMinorPatch }}" TAG="${{ steps.gitversion.outputs.PreReleaseLabel }}" - + # Default bump type BUMP_TYPE="patch" - # Determine bump type based on GitVersion's calculated version - if [[ "$VERSION_INCREMENT" =~ ^[1-9][0-9]*\.0\.0$ ]]; then - BUMP_TYPE="major" - elif [[ "$VERSION_INCREMENT" =~ ^[0-9]+\.[1-9][0-9]*\.0$ ]]; then - BUMP_TYPE="minor" - elif [[ "$VERSION_INCREMENT" =~ ^[0-9]+\.[0-9]+\.[1-9][0-9]*$ ]]; then - BUMP_TYPE="patch" - fi - - # Handle pre-release versions - if [[ -n "$TAG" ]]; then - BUMP_TYPE="pre${BUMP_TYPE}" + # If Python files changed → apply version logic + if [[ "${{ env.python_changed }}" == "true" ]]; then + if [[ "$VERSION_INCREMENT" =~ ^[1-9][0-9]*\.0\.0$ ]]; then + BUMP_TYPE="major" + elif [[ "$VERSION_INCREMENT" =~ ^[0-9]+\.[1-9][0-9]*\.0$ ]]; then + BUMP_TYPE="minor" + elif [[ "$VERSION_INCREMENT" =~ ^[0-9]+\.[0-9]+\.[1-9][0-9]*$ ]]; then + BUMP_TYPE="patch" + fi + + # Handle pre-release versions + if [[ -n "$TAG" ]]; then + BUMP_TYPE="pre${BUMP_TYPE}" + fi + else + echo "No Python files changed → forcing patch bump." fi echo "Version bump detected: $BUMP_TYPE" @@ -81,6 +85,7 @@ jobs: + - name: Update CHANGELOG.md if: github.ref == 'refs/heads/main' # Only update for stable releases uses: release-flow/keep-a-changelog-action@v3.0.0 From a3a2a324585830a2caa30a70b64a9e1213ba18ee Mon Sep 17 00:00:00 2001 From: Fabian Franz Steiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:45:03 +0000 Subject: [PATCH 2/3] Update CHANGELOG to reflect changes in version bump logic for GitHub Actions workflow --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60d0955..da2e1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- **GitHub Actions Workflow** + - Modified the version bump logic in `.github/workflows/release.yml` to apply major/minor/patch logic only if Python files have changed. If no Python files changed, the workflow now forces a patch bump to prevent unintended major or minor releases. + + ## [0.8.0] - 2025-06-13 ### Added From 183013194f9a467aad7422dd60b568a3eb9401ef Mon Sep 17 00:00:00 2001 From: fasteiner <75947402+fasteiner@users.noreply.github.com> Date: Fri, 13 Jun 2025 13:45:21 +0000 Subject: [PATCH 3/3] Update pyproject.toml for release 0.9.0-preview.2 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9af823d..b1e9d1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "xurrent" -version = "0.8.0" +version = "0.9.0-preview.2" authors = [ { name="Fabian Steiner", email="fabian@stei-ner.net" }, ] @@ -18,7 +18,7 @@ Homepage = "https://github.com/fasteiner/xurrent-python" Issues = "https://github.com/fasteiner/xurrent-python/issues" [tool.poetry] name = "xurrent" -version = "0.8.0" +version = "0.9.0-preview.2" description = "A python module to interact with the Xurrent API." authors = ["Ing. Fabian Franz Steiner BSc. "] readme = "README.md"