Skip to content

Commit 679e82b

Browse files
committed
Combine the CI and packaging workflows.
And only run the latter after the former.
1 parent 9b22313 commit 679e82b

File tree

2 files changed

+36
-43
lines changed

2 files changed

+36
-43
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,39 @@ jobs:
196196
run: python -m pip install tox
197197
- name: Run tox
198198
run: python -m tox -e "${{ matrix.python-version.toxenv }}"
199+
200+
packaging:
201+
needs: ci
202+
runs-on: ubuntu-latest
203+
204+
steps:
205+
- uses: actions/checkout@v3
206+
with:
207+
fetch-depth: 0
208+
- uses: actions/setup-python@v3
209+
with:
210+
python-version: "3.10"
211+
- name: Install dependencies
212+
run: python -m pip install build
213+
- name: Create packages
214+
run: python -m build .
215+
- uses: actions/upload-artifact@v3
216+
with:
217+
name: dist
218+
path: dist
219+
- name: Publish package
220+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
221+
uses: pypa/gh-action-pypi-publish@master
222+
with:
223+
user: __token__
224+
password: ${{ secrets.pypi_password }}
225+
- name: Create Release Notes
226+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
227+
uses: actions/github-script@v6
228+
with:
229+
github-token: ${{ secrets.GITHUB_TOKEN }}
230+
script: |
231+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
232+
tag_name: "${{ github.ref }}",
233+
generate_release_notes: true
234+
});

.github/workflows/packaging.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)