Skip to content
Merged

Dev #14

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d234b4a
Add automatic release notes generation and switch to "Keep a Changelo…
Feb 24, 2025
722d277
Fix workflow branch name casing and update CHANGELOG handling for rel…
Feb 24, 2025
bf0ceb4
Fix casing for 'Dev' branch in release workflow
Feb 24, 2025
156cc4b
Update release workflow to use semantic versioning and correct CHANGE…
Feb 24, 2025
660e2ca
Update and rename ChangeLog.md to CHANGELOG.md
fasteiner Feb 24, 2025
522ca24
Add version-regexp to changelog action for version validation, to ign…
Feb 24, 2025
590fcb7
Remove version-regexp from changelog action in release workflow and u…
Feb 24, 2025
9443455
Update version label in CHANGELOG to v0.0.2-beta.0
Feb 24, 2025
ab3041f
Update CHANGELOG format to adhere to Keep a Changelog and Semantic Ve…
Feb 24, 2025
c95313d
Update release workflow to set version as "[Unreleased]" for changelo…
Feb 24, 2025
91288e9
Update release workflow to set version as "unreleased" for changelog …
Feb 24, 2025
8cb5ea1
Fix release workflow to use correct output variable for changelog body
Feb 24, 2025
347ffbc
Add debug step to output changelog result in release workflow
Feb 24, 2025
0d50777
Update CHANGELOG to include release dates and format according to Sem…
Feb 24, 2025
c0c9d53
Fix release workflow to use correct output variable for changelog notes
Feb 24, 2025
efb014f
Add Python setup and build steps to release workflow
Feb 24, 2025
19b54f7
Refactor release workflow to include Python package installation and …
Feb 24, 2025
c8e5f12
Update pyproject.toml for release 0.4.0-preview.148
fasteiner Feb 24, 2025
387e092
Add steps to upload and publish distributions to PyPI in release work…
Feb 24, 2025
99c47df
Merge branch 'Dev' of github.com:fasteiner/xurrent-python into Dev
Feb 24, 2025
b96af19
Add conditional execution for release workflow on main branch
Feb 24, 2025
e891916
Update pyproject.toml for release 0.4.0-preview.169
fasteiner Feb 24, 2025
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
137 changes: 137 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
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: release-flow/keep-a-changelog-action@v3.0.0
with:
command: query
version: unreleased


- 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

- 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"


- 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 - <<EOF
import tomlkit
pyproject_file = "pyproject.toml"
with open(pyproject_file, "r", encoding="utf-8") as f:
data = tomlkit.load(f)
data["project"]["version"] = "${{ steps.gitversion.outputs.semVer }}"
data["tool"]["poetry"]["version"] = "${{ steps.gitversion.outputs.semVer }}"
with open(pyproject_file, "w", encoding="utf-8") as f:
tomlkit.dump(data, f)
EOF

- name: Commit Updated pyproject.toml
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update pyproject.toml for release ${{ steps.gitversion.outputs.semVer }}"
file_pattern: "pyproject.toml"

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build

- 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: v${{ steps.gitversion.outputs.semVer }}
name: Release v${{ steps.gitversion.outputs.semVer }}
body: "${{ steps.extract-changelog.outputs.release-notes }}"
draft: false
prerelease: ${{ github.ref == 'refs/heads/Dev' }}
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
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

# 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/
81 changes: 49 additions & 32 deletions ChangeLog.md → CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Change Log
# Changelog

## v0.0.2.12
All notable changes to this project will be documented in this file.

### New Features
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]

### Added

- Add automatic release notes generation, github release
- Build fully automated release on push on main

### Changed

- 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] - 2025-02-12

### Added

- configuration_items: add class ConfigurationItem
- configuration_items: add static methods: get_configuration_items, get_by_id
Expand All @@ -19,26 +36,26 @@
- Core: paging, ensure that '<>' gets removed


## v0.0.2.11
## [v0.0.2-beta.11] - 2025-01-08

### 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] - 2024-12-18

### 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] - 2024-12-11

### New Features
### Added

- Request, Workflow, Task, Person, Team: add non static methods: ref_str() --> return a reference string
- Request: add RequestCategory enum
Expand All @@ -51,62 +68,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] - 2024-12-10

### 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] - 2024-12-10

### Bug Fixes

- Task: `__update_object__` fixed

## v0.0.2.6
## [v0.0.2-beta.6] - 2024-12-10

### Bug Fixes

- Task: Fix update method

## v0.0.2.5
## [v0.0.2-beta.5] - 2024-12-10

### Bug Fixes

- Task: Fix update method

## v0.0.2.4
## [v0.0.2-beta.4] - 2024-12-10

### 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] - 2024-12-06

### 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] - 2024-12-06

### New Features
### Added

- Task: add base functionality for tasks
- Workflow: add methods: get_task_by_template_id, get_tasks
Expand All @@ -117,23 +134,23 @@

- 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] - 2024-12-06

### New Features
### Added

- Workflow: add base functionality for workflows
- People: add base functionality for people
- core: automatically get api user person object (optional, default: True)

## v0.0.2
## [v0.0.2-beta.0] - 2024-12-05

### New Features
### Added

- Request: add methods: archive, trash, restore

Expand All @@ -142,10 +159,10 @@
- Request: Fix get_request, get_notes method


## v0.0.1
## [v0.0.1] - 2024-12-05

### New Features
### Added

- Pagination: auto pagination get requests
- Retry-after: auto retry after 429 status code
- custom fields conversion (from and to object/dict)
- custom fields conversion (from and to object/dict)
43 changes: 43 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
mode: ContinuousDelivery
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)'
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']
Loading