Skip to content
Merged

Dev #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,34 @@ 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"
echo "bump_type=$BUMP_TYPE" >> $GITHUB_ENV




- 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
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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" },
]
Expand All @@ -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. <fabian.steiner@tttech.com>"]
readme = "README.md"
Expand Down
Loading