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