@@ -107,23 +107,39 @@ jobs:
107
107
run : |
108
108
python setup.py sdist bdist_wheel
109
109
110
- - name : Archive artifacts
110
+ - name : Extract Changes
111
+ run : |
112
+ import os, re
113
+ tag_name = os.environ['GITHUB_REF'].replace('refs/tags/', '')
114
+ changes = ''
115
+ with open('CHANGELOG.md') as f:
116
+ lines = f.read()
117
+ match = re.search('%s [()\d\-\s]*' % tag_name, lines)
118
+ if match:
119
+ lines = lines[match.end():]
120
+ changes = re.split('-----+', lines)[0].split('\n')
121
+ changes = '\n'.join(changes[:-2])
122
+ with open('release_notes.md', 'w') as f:
123
+ f.write(changes)
124
+
125
+ - name : Archive distribution artifacts
111
126
# Archive distribution files for use by auto (or manual) PyPI upload
112
127
uses : actions/upload-artifact@v2
113
128
with :
114
129
name : pypi-dist
115
130
path : ./dist
116
131
132
+ - name : Archive changelog artifacts
133
+ uses : actions/upload-artifact@v2
134
+ with :
135
+ path : release_notes.md
136
+
137
+
117
138
publish :
118
139
name : " Publish"
119
140
runs-on : ubuntu-latest
120
141
needs : [gh-pages, build]
121
142
steps :
122
- - name : Create Release
123
- uses : softprops/action-gh-release@v1
124
- with :
125
- draft : true
126
- body : " Test Release"
127
143
128
144
- name : Download documentation
129
145
uses : actions/download-artifact@v2
@@ -137,19 +153,34 @@ jobs:
137
153
name : pypi-dist
138
154
path : ./dist
139
155
156
+ - name : Download release notes
157
+ uses : actions/download-artifact@v2
158
+ with :
159
+ name : release_notes
160
+
161
+ - name : Zip Documentation
162
+ run : zip -r documentation.zip ./html-docs
163
+
140
164
- name : Display structure of downloaded files
141
165
run : ls -R
142
166
143
- - name : Deploy documentation
144
- uses : peaceiris/actions-gh-pages@v3
145
- with :
146
- github_token : ${{ secrets.GITHUB_TOKEN }}
147
- publish_dir : ./html-docs
148
-
149
- - name : Publish to PyPI
150
- uses : pypa/gh-action-pypi-publish@release/v1
167
+ - name : Create Release
168
+ uses : softprops/action-gh-release@v1
151
169
with :
152
- user : __token__
153
- password : ${{ secrets.PYPI_API_TOKEN }}
154
- verbose : true
170
+ draft : true
171
+ body_path : release_notes.md
172
+ body : " "
173
+
174
+ # - name: Deploy documentation
175
+ # uses: peaceiris/actions-gh-pages@v3
176
+ # with:
177
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
178
+ # publish_dir: ./html-docs
179
+ #
180
+ # - name: Publish to PyPI
181
+ # uses: pypa/gh-action-pypi-publish@release/v1
182
+ # with:
183
+ # user: __token__
184
+ # password: ${{ secrets.PYPI_API_TOKEN }}
185
+ # verbose: true
155
186
0 commit comments