Skip to content

Commit 9440002

Browse files
authored
Add a workflow to automate the release process (#1142)
1 parent 1a421a8 commit 9440002

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Build SDist and wheel
18+
run: pipx run build
19+
20+
- name: Upload SDist and wheel
21+
uses: actions/upload-artifact@v3
22+
with:
23+
path: dist/*
24+
if-no-files-found: error
25+
26+
- name: Check metadata
27+
run: pipx run twine check dist/*
28+
29+
publish:
30+
needs: [build]
31+
runs-on: ubuntu-latest
32+
if: github.event_name == 'release' && github.event.action == 'published'
33+
34+
steps:
35+
- name: Download SDist and wheel
36+
uses: actions/download-artifact@v3
37+
with:
38+
name: artifact
39+
path: dist
40+
41+
- name: Publish on PyPI
42+
uses: pypa/[email protected]
43+
with:
44+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)