-
Notifications
You must be signed in to change notification settings - Fork 72
34 lines (28 loc) · 895 Bytes
/
publish.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
# This workflows will test the build of the Python package into a software
# distribution and a wheel, and if a tag is pushed, also upload it to PyPI.
#
name: Publish to PyPI
on: [push, pull_request]
jobs:
publish-to-pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: pip install build
run: |
pip install build
pip list
- name: build --sdist --wheel .
run: |
python -m build --sdist --wheel .
ls -l dist
sha256sum dist/* | tee SHA256SUMS
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_api_token }}