@@ -107,23 +107,39 @@ jobs:
107107 run : |
108108 python setup.py sdist bdist_wheel
109109
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
111126 # Archive distribution files for use by auto (or manual) PyPI upload
112127 uses : actions/upload-artifact@v2
113128 with :
114129 name : pypi-dist
115130 path : ./dist
116131
132+ - name : Archive changelog artifacts
133+ uses : actions/upload-artifact@v2
134+ with :
135+ path : release_notes.md
136+
137+
117138 publish :
118139 name : " Publish"
119140 runs-on : ubuntu-latest
120141 needs : [gh-pages, build]
121142 steps :
122- - name : Create Release
123- uses : softprops/action-gh-release@v1
124- with :
125- draft : true
126- body : " Test Release"
127143
128144 - name : Download documentation
129145 uses : actions/download-artifact@v2
@@ -137,19 +153,34 @@ jobs:
137153 name : pypi-dist
138154 path : ./dist
139155
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+
140164 - name : Display structure of downloaded files
141165 run : ls -R
142166
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
151169 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
155186
0 commit comments