-
-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (45 loc) · 1.22 KB
/
py_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: (Py)Build and Publish to PyPi
on:
workflow_dispatch:
jobs:
wheels:
name: Build sdist and wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Preparations
run: python3 -m pip install check-manifest twine build wheel
- name: Build
run: |
python3 -m check_manifest
python3 -m build
- name: Check
run: twine check dist/*
- name: Upload
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.*
if-no-files-found: error
publish:
name: Publish to Pypi
needs: [wheels]
runs-on: ubuntu-latest
steps:
- name: Collect sdist and wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish wheels to PyPI
run: |
python3 -m pip install twine
python3 -m twine upload --verbose --skip-existing dist/*.whl
python3 -m twine upload --verbose --skip-existing dist/*tar.gz
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}