13
13
build :
14
14
uses : ./.github/workflows/build.yml
15
15
16
- tag_release :
16
+ bump :
17
17
needs : [isort, black, build]
18
18
runs-on : ubuntu-latest
19
19
outputs :
40
40
with :
41
41
token : ${{ steps.app-token.outputs.token }}
42
42
branch : main
43
+ noVersionBumpBehavior : warn
44
+
45
+ tag_release :
46
+ needs : [ bump ]
47
+ # Skip job in case no version bump is required
48
+ # in this case the variable tag will not be set by semver
49
+ if : ${{ needs.bump.outputs.tag != ''}}
50
+ runs-on : ubuntu-latest
51
+ steps :
52
+ - name : Create Github token
53
+ uses : actions/create-github-app-token@v1
54
+ id : app-token
55
+ with :
56
+ app-id : ${{ vars.DBBS_APP_ID }}
57
+ private-key : ${{ secrets.DBBS_APP_PRIVATE_KEY }}
58
+ - name : Checkout Code
59
+ uses : actions/checkout@v4
60
+ with :
61
+ fetch-depth : 0
62
+ token : ${{ steps.app-token.outputs.token }}
43
63
44
64
- name : Set up Python 3.11
45
65
uses : actions/setup-python@v5
@@ -49,26 +69,26 @@ jobs:
49
69
- name : Bump version in Python project
50
70
run : |
51
71
pip install --upgrade pip bump-my-version
52
- oldv="${{ steps.semver .outputs.current }}"
53
- newv="${{steps.semver .outputs.next }}"
72
+ oldv="${{ needs.bump .outputs.old_tag }}"
73
+ newv="${{needs.bump .outputs.tag }}"
54
74
# Bump the version, dropping the leading `v` with `${x:1}`
55
75
bump-my-version replace --current-version=${oldv:1} --new-version=${newv:1} pyproject.toml
56
76
57
77
- name : Commit & Push version change
58
78
uses : stefanzweifel/git-auto-commit-action@v5
59
79
with :
60
80
branch : main
61
- commit_message : ' docs: bump version: ${{ steps.semver .outputs.current }} → ${{ steps.semver .outputs.next }} [skip ci]'
81
+ commit_message : ' docs: bump version: ${{ needs.bump .outputs.old_tag }} → ${{ needs.bump .outputs.tag }} [skip ci]'
62
82
63
83
- name : Create tag
64
84
uses : rickstaa/action-create-tag@v1
65
85
with :
66
- tag : ${{ steps.semver .outputs.next }}
86
+ tag : ${{ needs.bump .outputs.tag }}
67
87
github_token : ${{ steps.app-token.outputs.token }}
68
88
69
89
release :
70
90
runs-on : ubuntu-latest
71
- needs : tag_release
91
+ needs : [bump, tag_release]
72
92
73
93
steps :
74
94
- name : Create Github token
@@ -93,17 +113,17 @@ jobs:
93
113
uses : requarks/changelog-action@v1
94
114
with :
95
115
token : ${{ steps.app-token.outputs.token }}
96
- fromTag : ${{ needs.tag_release .outputs.tag }}
97
- toTag : ${{ needs.tag_release .outputs.old_tag }}
116
+ fromTag : ${{ needs.bump .outputs.tag }}
117
+ toTag : ${{ needs.bump .outputs.old_tag }}
98
118
99
119
- name : Create Release
100
120
uses : ncipollo/release-action@v1.12.0
101
121
with :
102
122
allowUpdates : true
103
123
draft : false
104
124
makeLatest : true
105
- tag : ${{ needs.tag_release .outputs.tag }}
106
- name : ${{ needs.tag_release .outputs.tag }}
125
+ tag : ${{ needs.bump .outputs.tag }}
126
+ name : ${{ needs.bump .outputs.tag }}
107
127
body : ${{ steps.changelog.outputs.changes }}
108
128
token : ${{ steps.app-token.outputs.token }}
109
129
0 commit comments