From f28cdc5133798bc40a4531eff7253d5a9ec23888 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 13:31:27 +0100 Subject: [PATCH 1/2] Detect version bump type in release workflow and update CHANGELOG.md for breaking changes --- .github/workflows/release.yml | 32 +++++++++++++++++++++++++++++++- CHANGELOG.md | 8 ++++---- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4dd6305..cbfe5cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,13 +35,43 @@ jobs: command: query version: unreleased + - name: Detect Version Bump Type + id: version-bump + if: github.ref == 'refs/heads/main' # Only update for stable releases + run: | + CHANGELOG="${{ steps.extract-changelog.outputs.result }}" + echo "Extracted Changelog:" + echo "$CHANGELOG" + + # Default bump type + BUMP_TYPE="patch" + + if echo "$CHANGELOG" | grep -q "### Breaking Changes"; then + BUMP_TYPE="major" + elif echo "$CHANGELOG" | grep -q "### Removed"; then + BUMP_TYPE="major" + elif echo "$CHANGELOG" | grep -q "### Added"; then + BUMP_TYPE="minor" + elif echo "$CHANGELOG" | grep -q "### Deprecated"; then + BUMP_TYPE="minor" + elif echo "$CHANGELOG" | grep -q "### Changed"; then + BUMP_TYPE="minor" + elif echo "$CHANGELOG" | grep -q "### Fixed"; then + BUMP_TYPE="patch" + elif echo "$CHANGELOG" | grep -q "### Security"; then + BUMP_TYPE="patch" + 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 with: command: bump - version: unreleased + version: ${{ env.bump_type }} - name: Commit Updated CHANGELOG.md if: github.ref == 'refs/heads/main' diff --git a/CHANGELOG.md b/CHANGELOG.md index c0cbbd5..34d5517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,7 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Core: add enum LogLevel - Core: add method set_log_level to change the log level -### Changed +### Breaking Changes - Core: init: parameter for logger has been added, if not provided, a new logger will be created @@ -73,7 +73,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Person, Workflow, Task: inherit JsonSerializableDict --> make serializable - Request: close: make it possible to close a without a note (using default note) -### Changed +### Breaking Changes - Request: request.created_by, request.requested_by, request.requested_for, request.member are now Person objects - Workflow: workflow.manager is now a Person object @@ -84,7 +84,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Core: __append_per_page: exclude auto append for /me -### Changed +### Breaking Changes - Request: request.workflow is now a Workflow object instead of a dict --> request.workflow.id instead of request.workflow['id'] @@ -134,7 +134,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Workflow: Fix toString / __str__ method -### Changed +### Breaking Changes - Request: renamed get_request to get_requests - Workflow: get_workflow_task_by_template_id now returns a Task object List From f2bfff878a40dbd87d8a987a49331519e5ee7cda Mon Sep 17 00:00:00 2001 From: fasteiner <75947402+fasteiner@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:32:26 +0000 Subject: [PATCH 2/2] Update pyproject.toml for release 0.4.0-preview.193 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b51858..254bf61 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "xurrent" -version = "0.4.0-preview.169" +version = "0.4.0-preview.193" 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.4.0-preview.169" +version = "0.4.0-preview.193" description = "A python module to interact with the Xurrent API." authors = ["Ing. Fabian Franz Steiner BSc. "] readme = "README.md"