Skip to content

Commit fb86bdc

Browse files
authored
Merge pull request #14 from fasteiner/Dev
Dev
2 parents 9906c86 + e891916 commit fb86bdc

File tree

4 files changed

+268
-71
lines changed

4 files changed

+268
-71
lines changed

.github/workflows/release.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- Dev
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
create-release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Required for GitVersion to work correctly
21+
22+
- name: Install GitVersion
23+
uses: GitTools/actions/gitversion/setup@v0
24+
with:
25+
versionSpec: '5.x'
26+
27+
- name: Determine Version
28+
id: gitversion
29+
uses: GitTools/actions/gitversion/execute@v0
30+
31+
- name: Extract Release Notes from Changelog
32+
id: extract-changelog
33+
uses: release-flow/keep-a-changelog-action@v3.0.0
34+
with:
35+
command: query
36+
version: unreleased
37+
38+
39+
- name: Update CHANGELOG.md
40+
if: github.ref == 'refs/heads/main' # Only update for stable releases
41+
uses: release-flow/keep-a-changelog-action@v3.0.0
42+
with:
43+
command: bump
44+
version: unreleased
45+
46+
- name: Commit Updated CHANGELOG.md
47+
if: github.ref == 'refs/heads/main'
48+
uses: stefanzweifel/git-auto-commit-action@v5
49+
with:
50+
commit_message: "Update CHANGELOG for release ${{ steps.gitversion.outputs.semVer }}"
51+
file_pattern: "CHANGELOG.md"
52+
53+
54+
- uses: actions/setup-python@v5
55+
with:
56+
python-version: "3.x"
57+
58+
- name: Install Required Python Packages
59+
run: pip install build tomlkit
60+
61+
- name: Update Version in pyproject.toml
62+
run: |
63+
python - <<EOF
64+
import tomlkit
65+
pyproject_file = "pyproject.toml"
66+
with open(pyproject_file, "r", encoding="utf-8") as f:
67+
data = tomlkit.load(f)
68+
data["project"]["version"] = "${{ steps.gitversion.outputs.semVer }}"
69+
data["tool"]["poetry"]["version"] = "${{ steps.gitversion.outputs.semVer }}"
70+
with open(pyproject_file, "w", encoding="utf-8") as f:
71+
tomlkit.dump(data, f)
72+
EOF
73+
74+
- name: Commit Updated pyproject.toml
75+
uses: stefanzweifel/git-auto-commit-action@v5
76+
with:
77+
commit_message: "Update pyproject.toml for release ${{ steps.gitversion.outputs.semVer }}"
78+
file_pattern: "pyproject.toml"
79+
80+
- name: Build release distributions
81+
run: |
82+
# NOTE: put your own distribution build steps here.
83+
python -m pip install build
84+
python -m build
85+
86+
- name: Create Git Tag
87+
run: |
88+
git tag ${{ steps.gitversion.outputs.semVer }}
89+
git push origin ${{ steps.gitversion.outputs.semVer }}
90+
91+
- name: Create GitHub Release
92+
uses: softprops/action-gh-release@v1
93+
with:
94+
tag_name: v${{ steps.gitversion.outputs.semVer }}
95+
name: Release v${{ steps.gitversion.outputs.semVer }}
96+
body: "${{ steps.extract-changelog.outputs.release-notes }}"
97+
draft: false
98+
prerelease: ${{ github.ref == 'refs/heads/Dev' }}
99+
files: |
100+
dist/*.whl
101+
dist/*.tar.gz
102+
- name: Upload distributions
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: release-dists
106+
path: dist/
107+
pypi-publish:
108+
runs-on: ubuntu-latest
109+
needs:
110+
- create-release
111+
if: github.ref == 'refs/heads/main' # Ensures it only runs for the main branch
112+
permissions:
113+
# IMPORTANT: this permission is mandatory for trusted publishing
114+
id-token: write
115+
116+
# Dedicated environments with protections for publishing are strongly recommended.
117+
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
118+
environment:
119+
name: pypi
120+
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
121+
# url: https://pypi.org/p/YOURPROJECT
122+
#
123+
# ALTERNATIVE: if your GitHub Release name is the PyPI project version string
124+
# ALTERNATIVE: exactly, uncomment the following line instead:
125+
# url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
126+
127+
steps:
128+
- name: Retrieve release distributions
129+
uses: actions/download-artifact@v4
130+
with:
131+
name: release-dists
132+
path: dist/
133+
134+
- name: Publish release distributions to PyPI
135+
uses: pypa/gh-action-pypi-publish@release/v1
136+
with:
137+
packages-dir: dist/
Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
# Change Log
1+
# Changelog
22

3-
## v0.0.2.12
3+
All notable changes to this project will be documented in this file.
44

5-
### New Features
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Add automatic release notes generation, github release
13+
- Build fully automated release on push on main
14+
15+
### Changed
16+
17+
- Switch to using "Keep a Changelog" ChangeLog format
18+
- Change versioning to use semantic versioning (change log had to be updated as well)
19+
20+
## [v0.0.2-beta.12] - 2025-02-12
21+
22+
### Added
623

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

2138

22-
## v0.0.2.11
39+
## [v0.0.2-beta.11] - 2025-01-08
2340

24-
### New Features
41+
### Added
2542

2643
- Core: add function decode_api_id and encode_api_id to convert between nodeID and normal ID
2744

28-
## v0.0.2.10
45+
## [v0.0.2-beta.10] - 2024-12-18
2946

30-
### New Features
47+
### Added
3148

3249
- Core: add enum LogLevel
3350
- Core: add method set_log_level to change the log level
3451

35-
### Breaking Changes
52+
### Changed
3653

3754
- Core: init: parameter for logger has been added, if not provided, a new logger will be created
3855

39-
## v0.0.2.9
56+
## [v0.0.2-beta.9] - 2024-12-11
4057

41-
### New Features
58+
### Added
4259

4360
- Request, Workflow, Task, Person, Team: add non static methods: ref_str() --> return a reference string
4461
- Request: add RequestCategory enum
@@ -51,62 +68,62 @@
5168
- Tests: add tests for Request
5269
- Tests: add pre-commit hooks yaml file
5370

54-
### Bugfixes
71+
### Fixed
5572

5673
- Person, Workflow, Task: inherit JsonSerializableDict --> make serializable
5774
- Request: close: make it possible to close a without a note (using default note)
5875

59-
### Breaking Changes
76+
### Changed
6077

6178
- Request: request.created_by, request.requested_by, request.requested_for, request.member are now Person objects
6279
- Workflow: workflow.manager is now a Person object
6380

64-
## v0.0.2.8
81+
## [v0.0.2-beta.8] - 2024-12-10
6582

66-
### Bug Fixes
83+
### Fixed
6784

6885
- Core: __append_per_page: exclude auto append for /me
6986

70-
### Breaking Changes
87+
### Changed
7188

7289
- Request: request.workflow is now a Workflow object instead of a dict --> request.workflow.id instead of request.workflow['id']
7390

74-
## v0.0.2.7
91+
## [v0.0.2-beta.7] - 2024-12-10
7592

7693
### Bug Fixes
7794

7895
- Task: `__update_object__` fixed
7996

80-
## v0.0.2.6
97+
## [v0.0.2-beta.6] - 2024-12-10
8198

8299
### Bug Fixes
83100

84101
- Task: Fix update method
85102

86-
## v0.0.2.5
103+
## [v0.0.2-beta.5] - 2024-12-10
87104

88105
### Bug Fixes
89106

90107
- Task: Fix update method
91108

92-
## v0.0.2.4
109+
## [v0.0.2-beta.4] - 2024-12-10
93110

94-
### New Features
111+
### Added
95112

96113
- People: add non static methods: enable, archive, trash, restore
97114
- People: add static methods: create, get_people
98115
- Workflows: add static methods: get_workflows
99116

100-
## v0.0.2.3
117+
## [v0.0.2-beta.3] - 2024-12-06
101118

102-
### New Features
119+
### Added
103120

104121
- Task: add non static methods: get_workflow, close, approve, reject, cancel, create
105122
- Workflow: add non static methods: create_task
106123

107-
## v0.0.2.2
124+
## [v0.0.2-beta.2] - 2024-12-06
108125

109-
### New Features
126+
### Added
110127

111128
- Task: add base functionality for tasks
112129
- Workflow: add methods: get_task_by_template_id, get_tasks
@@ -117,23 +134,23 @@
117134

118135
- Workflow: Fix toString / __str__ method
119136

120-
### Breaking Changes
137+
### Changed
121138

122139
- Request: renamed get_request to get_requests
123140
- Workflow: get_workflow_task_by_template_id now returns a Task object List
124141

125142

126-
## v0.0.2.1
143+
## [v0.0.2-beta.1] - 2024-12-06
127144

128-
### New Features
145+
### Added
129146

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

134-
## v0.0.2
151+
## [v0.0.2-beta.0] - 2024-12-05
135152

136-
### New Features
153+
### Added
137154

138155
- Request: add methods: archive, trash, restore
139156

@@ -142,10 +159,10 @@
142159
- Request: Fix get_request, get_notes method
143160

144161

145-
## v0.0.1
162+
## [v0.0.1] - 2024-12-05
146163

147-
### New Features
164+
### Added
148165

149166
- Pagination: auto pagination get requests
150167
- Retry-after: auto retry after 429 status code
151-
- custom fields conversion (from and to object/dict)
168+
- custom fields conversion (from and to object/dict)

GitVersion.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
mode: ContinuousDelivery
2+
next-version: "0.3.0"
3+
major-version-bump-message: '\s?(breaking|major|breaking\schange)'
4+
minor-version-bump-message: '(adds?|features?|minor)\b'
5+
patch-version-bump-message: '\s?(fix|patch)'
6+
no-bump-message: '\+semver:\s?(none|skip)'
7+
assembly-informational-format: '{NuGetVersionV2}+Sha.{Sha}.Date.{CommitDate}'
8+
branches:
9+
master:
10+
tag: ""
11+
regex: ^main$
12+
develop:
13+
tag: preview
14+
regex: ^Dev$
15+
source-branches: ['master']
16+
pull-request:
17+
tag: PR
18+
feature:
19+
tag: alpha
20+
increment: Minor
21+
regex: f(eature(s)?)?[\/-]
22+
source-branches: ['master']
23+
hotfix:
24+
tag: fix
25+
increment: Patch
26+
regex: (hot)?fix(es)?[\/-]
27+
source-branches: ['master']
28+
29+
ignore:
30+
sha: []
31+
merge-message-formats: {}
32+
33+
34+
# feature:
35+
# tag: useBranchName
36+
# increment: Minor
37+
# regex: f(eature(s)?)?[/-]
38+
# source-branches: ['master']
39+
# hotfix:
40+
# tag: fix
41+
# increment: Patch
42+
# regex: (hot)?fix(es)?[/-]
43+
# source-branches: ['master']

0 commit comments

Comments
 (0)