From d234b4a5a4d085a7697f87798aa9a0d9797f6d36 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 11:21:06 +0100 Subject: [PATCH 01/21] Add automatic release notes generation and switch to "Keep a Changelog" format --- .github/workflows/release.yml | 67 +++++++++++++++++++++++++++++++++++ ChangeLog.md | 10 ++++++ GitVersion.yml | 43 ++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 GitVersion.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ab878e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,67 @@ +name: Create Release + +on: + push: + branches: + - main + - Dev + +permissions: + contents: write + +jobs: + create-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Required for GitVersion to work correctly + + - name: Install GitVersion + uses: GitTools/actions/gitversion/setup@v0 + with: + versionSpec: '5.x' + + - name: Determine Version + id: gitversion + uses: GitTools/actions/gitversion/execute@v0 + + - name: Extract Release Notes from Changelog + id: extract-changelog + uses: jupyter-naas/actions-extract-changelog@v1 + with: + changelog_path: "CHANGELOG.md" + version: "${{ steps.gitversion.outputs.semVer }}" + unreleased: true # Get content from the "Unreleased" section + + - name: Update CHANGELOG.md + if: github.ref == 'refs/heads/main' # Only update when it's a stable release + run: | + VERSION=${{ steps.gitversion.outputs.semVer }} + DATE=$(date +"%Y-%m-%d") + + # Replace `[Unreleased]` with `[VERSION] - DATE` + sed -i "s|## \[Unreleased\]|## [$VERSION] - $DATE|g" CHANGELOG.md + + # Commit and push changes + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + git add CHANGELOG.md + git commit -m "Update CHANGELOG for release $VERSION" + git push origin main + + - name: Create Git Tag + run: | + git tag ${{ steps.gitversion.outputs.semVer }} + git push origin ${{ steps.gitversion.outputs.semVer }} + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ steps.gitversion.outputs.semVer }} + name: Release ${{ steps.gitversion.outputs.semVer }} + body: "${{ steps.extract-changelog.outputs.changes }}" + draft: false + prerelease: ${{ github.ref == 'refs/heads/Dev' }} diff --git a/ChangeLog.md b/ChangeLog.md index 6f7b8c8..cbeb35b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,15 @@ # Change Log +## [Unreleased] + +### Added + +- Add automatic release notes generation, github release + +### Changed + +- Switch to using "Keep a Changelog" ChangeLog format + ## v0.0.2.12 ### New Features diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000..7971f9a --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,43 @@ +mode: ContinuousDelivery +next-version: "0.2.0" +major-version-bump-message: '\s?(breaking|major|breaking\schange)' +minor-version-bump-message: '(adds?|features?|minor)\b' +patch-version-bump-message: '\s?(fix|patch)' +no-bump-message: '\+semver:\s?(none|skip)' +assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}' +branches: + master: + tag: "" + regex: ^main$ + develop: + tag: preview + regex: ^Dev$ + source-branches: ['master'] + pull-request: + tag: PR + feature: + tag: alpha + increment: Minor + regex: f(eature(s)?)?[\/-] + source-branches: ['master'] + hotfix: + tag: fix + increment: Patch + regex: (hot)?fix(es)?[\/-] + source-branches: ['master'] + +ignore: + sha: [] +merge-message-formats: {} + + +# feature: +# tag: useBranchName +# increment: Minor +# regex: f(eature(s)?)?[/-] +# source-branches: ['master'] +# hotfix: +# tag: fix +# increment: Patch +# regex: (hot)?fix(es)?[/-] +# source-branches: ['master'] From 722d2777f4c9159fdc6092462748f4d5e86651c2 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 11:37:35 +0100 Subject: [PATCH 02/21] Fix workflow branch name casing and update CHANGELOG handling for releases --- .github/workflows/release.yml | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab878e9..546233a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - Dev + - dev permissions: contents: write @@ -30,27 +30,24 @@ jobs: - name: Extract Release Notes from Changelog id: extract-changelog - uses: jupyter-naas/actions-extract-changelog@v1 + uses: release-flow/keep-a-changelog-action@v3.0.0 with: - changelog_path: "CHANGELOG.md" - version: "${{ steps.gitversion.outputs.semVer }}" - unreleased: true # Get content from the "Unreleased" section + command: query + version: ${{ steps.gitversion.outputs.semVer }} - name: Update CHANGELOG.md - if: github.ref == 'refs/heads/main' # Only update when it's a stable release - run: | - VERSION=${{ steps.gitversion.outputs.semVer }} - DATE=$(date +"%Y-%m-%d") - - # Replace `[Unreleased]` with `[VERSION] - DATE` - sed -i "s|## \[Unreleased\]|## [$VERSION] - $DATE|g" 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: ${{ steps.gitversion.outputs.semVer }} - # Commit and push changes - git config --global user.name "github-actions" - git config --global user.email "github-actions@github.com" - git add CHANGELOG.md - git commit -m "Update CHANGELOG for release $VERSION" - git push origin main + - name: Commit Updated CHANGELOG.md + if: github.ref == 'refs/heads/main' + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Update CHANGELOG for release ${{ steps.gitversion.outputs.semVer }}" + file_pattern: "ChangeLog.md" - name: Create Git Tag run: | @@ -64,4 +61,4 @@ jobs: name: Release ${{ steps.gitversion.outputs.semVer }} body: "${{ steps.extract-changelog.outputs.changes }}" draft: false - prerelease: ${{ github.ref == 'refs/heads/Dev' }} + prerelease: ${{ github.ref == 'refs/heads/dev' }} From bf0ceb40776bd3f56b3a4cd8da3b181afcc18950 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 11:38:05 +0100 Subject: [PATCH 03/21] Fix casing for 'Dev' branch in release workflow --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 546233a..d6e6a7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - dev + - Dev permissions: contents: write @@ -61,4 +61,4 @@ jobs: name: Release ${{ steps.gitversion.outputs.semVer }} body: "${{ steps.extract-changelog.outputs.changes }}" draft: false - prerelease: ${{ github.ref == 'refs/heads/dev' }} + prerelease: ${{ github.ref == 'refs/heads/Dev' }} From 156cc4ba3cb0e690733d3b80f79ed89e0e8eaaf2 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 11:45:52 +0100 Subject: [PATCH 04/21] Update release workflow to use semantic versioning and correct CHANGELOG file naming --- .github/workflows/release.yml | 10 +++++----- ChangeLog.md | 1 + GitVersion.yml | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d6e6a7b..cf58329 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,21 +33,21 @@ jobs: uses: release-flow/keep-a-changelog-action@v3.0.0 with: command: query - version: ${{ steps.gitversion.outputs.semVer }} + version: v${{ steps.gitversion.outputs.semVer }} - 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: ${{ steps.gitversion.outputs.semVer }} + version: v${{ steps.gitversion.outputs.semVer }} - name: Commit Updated CHANGELOG.md if: github.ref == 'refs/heads/main' uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: "Update CHANGELOG for release ${{ steps.gitversion.outputs.semVer }}" - file_pattern: "ChangeLog.md" + file_pattern: "CHANGELOG.md" - name: Create Git Tag run: | @@ -57,8 +57,8 @@ jobs: - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.gitversion.outputs.semVer }} - name: Release ${{ steps.gitversion.outputs.semVer }} + tag_name: v${{ steps.gitversion.outputs.semVer }} + name: Release v${{ steps.gitversion.outputs.semVer }} body: "${{ steps.extract-changelog.outputs.changes }}" draft: false prerelease: ${{ github.ref == 'refs/heads/Dev' }} diff --git a/ChangeLog.md b/ChangeLog.md index cbeb35b..bc7fdaf 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -9,6 +9,7 @@ ### Changed - Switch to using "Keep a Changelog" ChangeLog format +- Change versioning to use semantic versioning ## v0.0.2.12 diff --git a/GitVersion.yml b/GitVersion.yml index 7971f9a..1efa201 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,5 +1,5 @@ mode: ContinuousDelivery -next-version: "0.2.0" +next-version: "0.3.0" major-version-bump-message: '\s?(breaking|major|breaking\schange)' minor-version-bump-message: '(adds?|features?|minor)\b' patch-version-bump-message: '\s?(fix|patch)' From 660e2ca17145d18e1a087984d3f3b03f09621fb8 Mon Sep 17 00:00:00 2001 From: Fabian Franz Steiner <75947402+fasteiner@users.noreply.github.com> Date: Mon, 24 Feb 2025 11:47:28 +0100 Subject: [PATCH 05/21] Update and rename ChangeLog.md to CHANGELOG.md --- ChangeLog.md => CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ChangeLog.md => CHANGELOG.md (95%) diff --git a/ChangeLog.md b/CHANGELOG.md similarity index 95% rename from ChangeLog.md rename to CHANGELOG.md index bc7fdaf..7a3a057 100644 --- a/ChangeLog.md +++ b/CHANGELOG.md @@ -159,4 +159,4 @@ - Pagination: auto pagination get requests - Retry-after: auto retry after 429 status code -- custom fields conversion (from and to object/dict) \ No newline at end of file +- custom fields conversion (from and to object/dict) From 522ca24405b45a5b5a2c87236956a4fc3ee20bf7 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 11:59:32 +0100 Subject: [PATCH 06/21] Add version-regexp to changelog action for version validation, to ignore old version schema --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf58329..0b9eadc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,7 @@ jobs: id: extract-changelog uses: release-flow/keep-a-changelog-action@v3.0.0 with: + version-regexp: '^v?\d+\.\d+\.\d+(-[\w\.]+)?(\+\w+)?$' command: query version: v${{ steps.gitversion.outputs.semVer }} @@ -39,6 +40,7 @@ jobs: if: github.ref == 'refs/heads/main' # Only update for stable releases uses: release-flow/keep-a-changelog-action@v3.0.0 with: + version-regexp: '^v?\d+\.\d+\.\d+(-[\w\.]+)?(\+\w+)?$' command: bump version: v${{ steps.gitversion.outputs.semVer }} From 590fcb76dbd5f3730f9722fd5b9596d595b9f047 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:04:32 +0100 Subject: [PATCH 07/21] Remove version-regexp from changelog action in release workflow and update CHANGELOG format for semantic versioning --- .github/workflows/release.yml | 2 -- CHANGELOG.md | 58 +++++++++++++++++------------------ 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b9eadc..cf58329 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,6 @@ jobs: id: extract-changelog uses: release-flow/keep-a-changelog-action@v3.0.0 with: - version-regexp: '^v?\d+\.\d+\.\d+(-[\w\.]+)?(\+\w+)?$' command: query version: v${{ steps.gitversion.outputs.semVer }} @@ -40,7 +39,6 @@ jobs: if: github.ref == 'refs/heads/main' # Only update for stable releases uses: release-flow/keep-a-changelog-action@v3.0.0 with: - version-regexp: '^v?\d+\.\d+\.\d+(-[\w\.]+)?(\+\w+)?$' command: bump version: v${{ steps.gitversion.outputs.semVer }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a3a057..22ce621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,11 +9,11 @@ ### Changed - Switch to using "Keep a Changelog" ChangeLog format -- Change versioning to use semantic versioning +- Change versioning to use semantic versioning (change log had to be updated as well) -## v0.0.2.12 +## v0.0.2-beta.12 -### New Features +### Added - configuration_items: add class ConfigurationItem - configuration_items: add static methods: get_configuration_items, get_by_id @@ -30,26 +30,26 @@ - Core: paging, ensure that '<>' gets removed -## v0.0.2.11 +## v0.0.2-beta.11 -### New Features +### Added - Core: add function decode_api_id and encode_api_id to convert between nodeID and normal ID -## v0.0.2.10 +## v0.0.2-beta.10 -### New Features +### Added - Core: add enum LogLevel - Core: add method set_log_level to change the log level -### Breaking Changes +### Changed - Core: init: parameter for logger has been added, if not provided, a new logger will be created -## v0.0.2.9 +## v0.0.2-beta.9 -### New Features +### Added - Request, Workflow, Task, Person, Team: add non static methods: ref_str() --> return a reference string - Request: add RequestCategory enum @@ -62,62 +62,62 @@ - Tests: add tests for Request - Tests: add pre-commit hooks yaml file -### Bugfixes +### Fixed - Person, Workflow, Task: inherit JsonSerializableDict --> make serializable - Request: close: make it possible to close a without a note (using default note) -### Breaking Changes +### Changed - Request: request.created_by, request.requested_by, request.requested_for, request.member are now Person objects - Workflow: workflow.manager is now a Person object -## v0.0.2.8 +## v0.0.2-beta.8 -### Bug Fixes +### Fixed - Core: __append_per_page: exclude auto append for /me -### Breaking Changes +### Changed - Request: request.workflow is now a Workflow object instead of a dict --> request.workflow.id instead of request.workflow['id'] -## v0.0.2.7 +## v0.0.2-beta.7 ### Bug Fixes - Task: `__update_object__` fixed -## v0.0.2.6 +## v0.0.2-beta.6 ### Bug Fixes - Task: Fix update method -## v0.0.2.5 +## v0.0.2-beta.5 ### Bug Fixes - Task: Fix update method -## v0.0.2.4 +## v0.0.2-beta.4 -### New Features +### Added - People: add non static methods: enable, archive, trash, restore - People: add static methods: create, get_people - Workflows: add static methods: get_workflows -## v0.0.2.3 +## v0.0.2-beta.3 -### New Features +### Added - Task: add non static methods: get_workflow, close, approve, reject, cancel, create - Workflow: add non static methods: create_task -## v0.0.2.2 +## v0.0.2-beta.2 -### New Features +### Added - Task: add base functionality for tasks - Workflow: add methods: get_task_by_template_id, get_tasks @@ -128,15 +128,15 @@ - Workflow: Fix toString / __str__ method -### Breaking Changes +### Changed - Request: renamed get_request to get_requests - Workflow: get_workflow_task_by_template_id now returns a Task object List -## v0.0.2.1 +## v0.0.2-beta.1 -### New Features +### Added - Workflow: add base functionality for workflows - People: add base functionality for people @@ -144,7 +144,7 @@ ## v0.0.2 -### New Features +### Added - Request: add methods: archive, trash, restore @@ -155,7 +155,7 @@ ## v0.0.1 -### New Features +### Added - Pagination: auto pagination get requests - Retry-after: auto retry after 429 status code From 944345552b9ec33692cda021609c7d8864911a18 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:05:55 +0100 Subject: [PATCH 08/21] Update version label in CHANGELOG to v0.0.2-beta.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ce621..78956f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -142,7 +142,7 @@ - People: add base functionality for people - core: automatically get api user person object (optional, default: True) -## v0.0.2 +## v0.0.2-beta.0 ### Added From ab3041fbd89cc9494bf31206e33e3c2c0472685b Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:08:09 +0100 Subject: [PATCH 09/21] Update CHANGELOG format to adhere to Keep a Changelog and Semantic Versioning --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78956f1..11b422a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -# Change Log +# Changelog + +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] From c95313dd641e21bdc36023f8ddcaf485e152b59f Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:10:32 +0100 Subject: [PATCH 10/21] Update release workflow to set version as "[Unreleased]" for changelog generation --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf58329..6df6a36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: uses: release-flow/keep-a-changelog-action@v3.0.0 with: command: query - version: v${{ steps.gitversion.outputs.semVer }} + version: "[Unreleased]" - name: Update CHANGELOG.md if: github.ref == 'refs/heads/main' # Only update for stable releases From 91288e93aadc30a6c27c563f8d1f7e604e2801d5 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:11:25 +0100 Subject: [PATCH 11/21] Update release workflow to set version as "unreleased" for changelog generation --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6df6a36..6aefc69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: uses: release-flow/keep-a-changelog-action@v3.0.0 with: command: query - version: "[Unreleased]" + version: unreleased - name: Update CHANGELOG.md if: github.ref == 'refs/heads/main' # Only update for stable releases From 8cb5ea1262f87aaaf9d7068fbc7d031dec8ea9f5 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:18:28 +0100 Subject: [PATCH 12/21] Fix release workflow to use correct output variable for changelog body --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6aefc69..01d7631 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -59,6 +59,6 @@ jobs: with: tag_name: v${{ steps.gitversion.outputs.semVer }} name: Release v${{ steps.gitversion.outputs.semVer }} - body: "${{ steps.extract-changelog.outputs.changes }}" + body: "${{ steps.extract-changelog.outputs.result }}" draft: false prerelease: ${{ github.ref == 'refs/heads/Dev' }} From 347ffbcaedc6c26601018cf4cf5d1e5ffc158a83 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:21:25 +0100 Subject: [PATCH 13/21] Add debug step to output changelog result in release workflow --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01d7631..fc5e272 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,6 +34,10 @@ jobs: with: command: query version: unreleased + + - name: Debug Changelog Output + run: echo "${{ steps.extract-changelog.outputs.result }}" + - name: Update CHANGELOG.md if: github.ref == 'refs/heads/main' # Only update for stable releases From 0d5077738fd99391866696301e7ffa436e6b5c2e Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:29:24 +0100 Subject: [PATCH 14/21] Update CHANGELOG to include release dates and format according to Semantic Versioning --- CHANGELOG.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b422a..1f8ce30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Switch to using "Keep a Changelog" ChangeLog format - Change versioning to use semantic versioning (change log had to be updated as well) -## v0.0.2-beta.12 +## [v0.0.2-beta.12] - 2025-02-12 ### Added @@ -35,13 +35,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Core: paging, ensure that '<>' gets removed -## v0.0.2-beta.11 +## [v0.0.2-beta.11] - 2025-01-08 ### Added - Core: add function decode_api_id and encode_api_id to convert between nodeID and normal ID -## v0.0.2-beta.10 +## [v0.0.2-beta.10] - 2024-12-18 ### Added @@ -52,7 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Core: init: parameter for logger has been added, if not provided, a new logger will be created -## v0.0.2-beta.9 +## [v0.0.2-beta.9] - 2024-12-11 ### Added @@ -77,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Request: request.created_by, request.requested_by, request.requested_for, request.member are now Person objects - Workflow: workflow.manager is now a Person object -## v0.0.2-beta.8 +## [v0.0.2-beta.8] - 2024-12-10 ### Fixed @@ -87,25 +87,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Request: request.workflow is now a Workflow object instead of a dict --> request.workflow.id instead of request.workflow['id'] -## v0.0.2-beta.7 +## [v0.0.2-beta.7] - 2024-12-10 ### Bug Fixes - Task: `__update_object__` fixed -## v0.0.2-beta.6 +## [v0.0.2-beta.6] - 2024-12-10 ### Bug Fixes - Task: Fix update method -## v0.0.2-beta.5 +## [v0.0.2-beta.5] - 2024-12-10 ### Bug Fixes - Task: Fix update method -## v0.0.2-beta.4 +## [v0.0.2-beta.4] - 2024-12-10 ### Added @@ -113,14 +113,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - People: add static methods: create, get_people - Workflows: add static methods: get_workflows -## v0.0.2-beta.3 +## [v0.0.2-beta.3] - 2024-12-06 ### Added - Task: add non static methods: get_workflow, close, approve, reject, cancel, create - Workflow: add non static methods: create_task -## v0.0.2-beta.2 +## [v0.0.2-beta.2] - 2024-12-06 ### Added @@ -139,7 +139,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Workflow: get_workflow_task_by_template_id now returns a Task object List -## v0.0.2-beta.1 +## [v0.0.2-beta.1] - 2024-12-06 ### Added @@ -147,7 +147,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - People: add base functionality for people - core: automatically get api user person object (optional, default: True) -## v0.0.2-beta.0 +## [v0.0.2-beta.0] - 2024-12-05 ### Added @@ -158,7 +158,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Request: Fix get_request, get_notes method -## v0.0.1 +## [v0.0.1] - 2024-12-05 ### Added From c0c9d537085004e443eea22b7846aa7652a94718 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:50:11 +0100 Subject: [PATCH 15/21] Fix release workflow to use correct output variable for changelog notes --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc5e272..d883c6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,9 +34,9 @@ jobs: with: command: query version: unreleased - + - name: Debug Changelog Output - run: echo "${{ steps.extract-changelog.outputs.result }}" + run: echo "${{ steps.extract-changelog.outputs.release-notes }}" - name: Update CHANGELOG.md @@ -44,7 +44,7 @@ jobs: uses: release-flow/keep-a-changelog-action@v3.0.0 with: command: bump - version: v${{ steps.gitversion.outputs.semVer }} + version: unreleased - name: Commit Updated CHANGELOG.md if: github.ref == 'refs/heads/main' @@ -63,6 +63,6 @@ jobs: with: tag_name: v${{ steps.gitversion.outputs.semVer }} name: Release v${{ steps.gitversion.outputs.semVer }} - body: "${{ steps.extract-changelog.outputs.result }}" + body: "${{ steps.extract-changelog.outputs.release-notes }}" draft: false prerelease: ${{ github.ref == 'refs/heads/Dev' }} From efb014ffd4b747066b4d57dc9c4116b501f4aa6f Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 12:55:19 +0100 Subject: [PATCH 16/21] Add Python setup and build steps to release workflow --- .github/workflows/release.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d883c6c..9a70185 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,16 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Required for GitVersion to work correctly + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Build release distributions + run: | + # NOTE: put your own distribution build steps here. + python -m pip install build + python -m build - name: Install GitVersion uses: GitTools/actions/gitversion/setup@v0 @@ -66,3 +76,6 @@ jobs: body: "${{ steps.extract-changelog.outputs.release-notes }}" draft: false prerelease: ${{ github.ref == 'refs/heads/Dev' }} + files: | + dist/*.whl + dist/*.tar.gz From 19b54f7433b59bf9af9b531faa2bc978b134fc9c Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 13:06:33 +0100 Subject: [PATCH 17/21] Refactor release workflow to include Python package installation and update version in pyproject.toml --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a70185..85f35cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,16 +18,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Required for GitVersion to work correctly - - - uses: actions/setup-python@v5 - with: - python-version: "3.x" - - - name: Build release distributions - run: | - # NOTE: put your own distribution build steps here. - python -m pip install build - python -m build - name: Install GitVersion uses: GitTools/actions/gitversion/setup@v0 @@ -45,9 +35,6 @@ jobs: command: query version: unreleased - - name: Debug Changelog Output - run: echo "${{ steps.extract-changelog.outputs.release-notes }}" - - name: Update CHANGELOG.md if: github.ref == 'refs/heads/main' # Only update for stable releases @@ -62,6 +49,39 @@ jobs: with: commit_message: "Update CHANGELOG for release ${{ steps.gitversion.outputs.semVer }}" file_pattern: "CHANGELOG.md" + + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install Required Python Packages + run: pip install build tomlkit + + - name: Update Version in pyproject.toml + run: | + python - < Date: Mon, 24 Feb 2025 12:07:16 +0000 Subject: [PATCH 18/21] Update pyproject.toml for release 0.4.0-preview.148 --- pyproject.toml | 78 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 73061fd..e56bfbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,39 +1,39 @@ -[project] -name = "xurrent" -version = "0.0.2.12" -authors = [ - { name="Fabian Steiner", email="fabian@stei-ner.net" }, -] -description = "A python module to interact with the Xurrent API." -readme = "README.md" -requires-python = ">=3.9" -classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] - -[project.urls] -Homepage = "https://github.com/fasteiner/xurrent-python" -Issues = "https://github.com/fasteiner/xurrent-python/issues" -[tool.poetry] -name = "xurrent" -version = "0.0.2.11" -description = "A python module to interact with the Xurrent API." -authors = ["Ing. Fabian Franz Steiner BSc. "] -readme = "README.md" - -[tool.poetry.dependencies] -python = ">=3.9" -requests = "^2.32.3" - - -[tool.poetry.group.dev.dependencies] -pytest = "^8.3.4" -python-dotenv = "^1.0.1" -mock = "^5.1.0" -pre-commit = "^4.0.1" - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +[project] +name = "xurrent" +version = "0.4.0-preview.148" +authors = [ + { name="Fabian Steiner", email="fabian@stei-ner.net" }, +] +description = "A python module to interact with the Xurrent API." +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] + +[project.urls] +Homepage = "https://github.com/fasteiner/xurrent-python" +Issues = "https://github.com/fasteiner/xurrent-python/issues" +[tool.poetry] +name = "xurrent" +version = "0.4.0-preview.148" +description = "A python module to interact with the Xurrent API." +authors = ["Ing. Fabian Franz Steiner BSc. "] +readme = "README.md" + +[tool.poetry.dependencies] +python = ">=3.9" +requests = "^2.32.3" + + +[tool.poetry.group.dev.dependencies] +pytest = "^8.3.4" +python-dotenv = "^1.0.1" +mock = "^5.1.0" +pre-commit = "^4.0.1" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" From 387e09258149101a60f956b321edf3740a2ed2ee Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 13:16:06 +0100 Subject: [PATCH 19/21] Add steps to upload and publish distributions to PyPI in release workflow --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 36 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85f35cf..f6d2fa6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -99,3 +99,38 @@ jobs: files: | dist/*.whl dist/*.tar.gz + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + pypi-publish: + runs-on: ubuntu-latest + needs: + - create-release + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules + environment: + name: pypi + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: + # url: https://pypi.org/p/YOURPROJECT + # + # ALTERNATIVE: if your GitHub Release name is the PyPI project version string + # ALTERNATIVE: exactly, uncomment the following line instead: + # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8ce30..c0cbbd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add automatic release notes generation, github release +- Build fully automated release on push on main ### Changed From b96af19416ca6376c3f4af7e0ed613b516a58719 Mon Sep 17 00:00:00 2001 From: "Ing. Fabian Franz Steiner BSc." Date: Mon, 24 Feb 2025 13:18:12 +0100 Subject: [PATCH 20/21] Add conditional execution for release workflow on main branch --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6d2fa6..4dd6305 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,6 +108,7 @@ jobs: runs-on: ubuntu-latest needs: - create-release + if: github.ref == 'refs/heads/main' # Ensures it only runs for the main branch permissions: # IMPORTANT: this permission is mandatory for trusted publishing id-token: write From e891916a4fad38a83dcd9979bbca731d7595db69 Mon Sep 17 00:00:00 2001 From: fasteiner <75947402+fasteiner@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:18:43 +0000 Subject: [PATCH 21/21] Update pyproject.toml for release 0.4.0-preview.169 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e56bfbc..2b51858 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "xurrent" -version = "0.4.0-preview.148" +version = "0.4.0-preview.169" 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.148" +version = "0.4.0-preview.169" description = "A python module to interact with the Xurrent API." authors = ["Ing. Fabian Franz Steiner BSc. "] readme = "README.md"