-
Notifications
You must be signed in to change notification settings - Fork 1.7k
30 lines (28 loc) · 919 Bytes
/
release.yml
File metadata and controls
30 lines (28 loc) · 919 Bytes
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
# Automatically publish to PyPI when a GitHub release is published
name: Publish to PyPI
# Run this action when a release is published
on: # yamllint disable-line rule:truthy
release:
types: [published]
# Updates version.txt, builds, and pushes to PyPI
jobs:
release:
name: Builds and publishes to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Install pypa/build
run: python -m pip install build --user
- name: Build binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_KEY }}