3
3
workflow_dispatch :
4
4
inputs :
5
5
version :
6
- description : ' The version to release (e.g 1.2.3) '
6
+ description : ' The version to bump to '
7
7
required : true
8
- default : ' '
9
- type : string
8
+ default : ' minor'
9
+ type : choice
10
+ options :
11
+ - major
12
+ - minor
13
+ - patch
10
14
11
15
12
16
jobs :
15
19
permissions :
16
20
contents : write
17
21
outputs :
18
- version : ${{ github.event.inputs.version }}
22
+ version : ${{ steps.tag_version.outputs.new_version }}
19
23
previous_tag : ${{ steps.tag_version.outputs.previous_tag }}
20
24
bump_commit_sha : ${{ steps.bumpversion.outputs.commit_hash }}
21
25
pr_number : ${{ steps.cpr.outputs.pull-request-number }}
@@ -34,41 +38,42 @@ jobs:
34
38
with :
35
39
python-version : " 3.12"
36
40
- name : Create bumpversion
37
- if : github.event.inputs.version
41
+ if : steps.tag_version.outputs.new_version
38
42
run : |
39
43
pip install bump2version
40
- bump2version --new-version ${{ github.event.inputs.version }} setup.cfg tutoraspects/__about__.py .ci/config.yml
44
+ bump2version --new-version ${{ steps.tag_version.outputs.new_version }} setup.cfg tutoraspects/__about__.py .ci/config.yml
41
45
- name : Update Changelog
42
- if : github.event.inputs.version
46
+ if : steps.tag_version.outputs.new_version
43
47
uses :
stefanzweifel/[email protected]
44
48
with :
45
- latest-version : ${{ github.event.inputs.version }}
49
+ latest-version : ${{ steps.tag_version.outputs.new_tag }}
46
50
release-notes : ${{ steps.tag_version.outputs.changelog }}
47
51
- name : Push branch
48
- if : github.event.inputs.version
52
+ if : steps.tag_version.outputs.new_version
49
53
run : |
50
- branch_name="bot/v${{ github.event.inputs.version }}"
54
+ branch_name="bot/v${{ steps.tag_version.outputs.new_version }}"
51
55
git fetch --prune origin
52
56
if git show-ref --quiet refs/remotes/origin/$branch_name; then
53
57
git push --delete origin $branch_name
54
58
fi
55
59
git checkout -b $branch_name || git checkout $branch_name
56
60
git push origin $branch_name
57
61
- name : Create Pull Request
62
+ if : steps.tag_version.outputs.new_version
58
63
id : cpr
59
64
uses : peter-evans/create-pull-request@v6
60
65
with :
61
66
token : ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
62
- title : " chore: preparing release ${{ github.event.inputs.version }}"
63
- commit-message : " chore: preparing release ${{ github.event.inputs.version }}"
64
- branch : " bot/v${{github.event.inputs.version }}"
67
+ title : " chore: preparing release ${{ steps.tag_version.outputs.new_version }}"
68
+ commit-message : " chore: preparing release ${{ steps.tag_version.outputs.new_version }}"
69
+ branch : " bot/v${{steps.tag_version.outputs.new_version }}"
65
70
base : main
66
71
body : |
67
- Automated version bump for release ${{ github.event.inputs.version }}.
72
+ Automated version bump for release ${{ steps.tag_version.outputs.new_version }}.
68
73
69
74
This pull request was automatically generated. It includes the following changes:
70
75
71
- - Version: ${{ github.event.inputs.version }}
76
+ - Version: ${{ steps.tag_version.outputs.new_version }}
72
77
- Previous version: ${{ steps.tag_version.outputs.previous_tag }}
73
78
74
79
${{ steps.tag_version.outputs.changelog }}
0 commit comments