-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (44 loc) · 1.2 KB
/
pypi.yaml
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: Publish
on:
release:
types: [published]
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install build twine
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Build the package
run: python -m build --sdist --wheel
- name: Validate wheels
run: |
tree dist
twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./build/*
- name: Publish the package
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Attach wheels to GitHub release
if: github.event_name == 'release'
uses: AButler/[email protected]
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}