10
10
env :
11
11
PYTHON_VERSION : 3.8
12
12
NEW_VERSION : ${{ inputs.version }}
13
+ NEW_TAG : v${{ inputs.version }}
13
14
14
15
jobs :
15
16
increment-version :
16
- name : Bump project version and commit it
17
+ name : Bump version, commit and create tag
17
18
runs-on : ubuntu-latest
18
19
steps :
19
20
- uses : actions/checkout@v4
@@ -28,20 +29,26 @@ jobs:
28
29
run : poetry install --only=release
29
30
30
31
- name : Bump project version
31
- id : script
32
32
run : poe bump "${{ env.NEW_VERSION }}"
33
33
34
34
- uses : EndBug/add-and-commit@v9
35
- name : Commit the changes
35
+ id : commit_and_tag
36
+ name : Commit the changes and create tag
36
37
with :
37
38
message : " Increment version to ${{ env.NEW_VERSION }}"
39
+ tag : " ${{ env.NEW_TAG }} --force"
38
40
39
41
build :
40
42
name : Get changelog and build the distribution package
41
43
runs-on : ubuntu-latest
42
44
needs : increment-version
45
+ outputs :
46
+ changelog : ${{ steps.generate_changelog.outputs.changelog }}
43
47
steps :
44
48
- uses : actions/checkout@v4
49
+ with :
50
+ ref : ${{ env.NEW_TAG }}
51
+
45
52
- name : Install Python tools
46
53
uses :
BrandonLWhite/[email protected]
47
54
- uses : actions/setup-python@v5
@@ -50,16 +57,23 @@ jobs:
50
57
cache : poetry
51
58
52
59
- name : Install dependencies
53
- run : poetry install --only =release
60
+ run : poetry install --with =release --extras=docs
54
61
55
62
- name : Install pandoc
56
63
run : sudo apt update && sudo apt install pandoc -y
57
64
58
65
- name : Obtain the changelog
59
- run : echo "changelog=$(poe changelog)" >> $GITHUB_OUTPUT
66
+ id : generate_changelog
67
+ run : |
68
+ poe docs
69
+ {
70
+ echo 'changelog<<EOF'
71
+ poe --quiet changelog
72
+ echo EOF
73
+ } >> "$GITHUB_OUTPUT"
60
74
61
75
- name : Build a binary wheel and a source tarball
62
- run : poetry build
76
+ run : poe build
63
77
64
78
- name : Store the distribution packages
65
79
uses : actions/upload-artifact@v4
@@ -88,36 +102,28 @@ jobs:
88
102
make-github-release :
89
103
name : Create GitHub release
90
104
runs-on : ubuntu-latest
91
- needs : publish-to-pypi
105
+ needs : [build, publish-to-pypi]
92
106
env :
93
107
CHANGELOG : ${{ needs.build.outputs.changelog }}
94
108
steps :
95
- - name : Tag the commit
96
- id : tag_version
97
- uses : mathieudutour/github-tag-action@v6
98
- with :
99
- github_token : ${{ secrets.GITHUB_TOKEN }}
100
- custom_tag : ${{ env.NEW_VERSION }}
101
-
102
109
- name : Download all the dists
103
- uses : actions/download-artifact@v3
110
+ uses : actions/download-artifact@v4
104
111
with :
105
112
name : python-package-distributions
106
113
path : dist/
107
114
108
115
- name : Create a GitHub release
109
116
id : make_release
110
117
uses : ncipollo/release-action@v1
111
- env :
112
- NEW_TAG : ${{ steps.tag_version.outputs.new_tag }}
113
118
with :
114
119
tag : ${{ env.NEW_TAG }}
115
120
name : Release ${{ env.NEW_TAG }}
116
121
body : ${{ env.CHANGELOG }}
117
122
artifacts : dist/*
118
123
- name : Send release toot to Fosstodon
119
124
uses : cbrgm/mastodon-github-action@v2
125
+ continue-on-error : true
120
126
with :
121
127
access-token : ${{ secrets.MASTODON_ACCESS_TOKEN }}
122
128
url : ${{ secrets.MASTODON_URL }}
123
- message : " Version ${{ steps.tag_version.outputs.new_tag }} of beets has been released! Check out all of the new changes at ${{ steps.create_release .outputs.html_url }}"
129
+ message : " Version ${{ env.NEW_TAG }} of beets has been released! Check out all of the new changes at ${{ steps.make_release .outputs.html_url }}"
0 commit comments