-
Notifications
You must be signed in to change notification settings - Fork 27
28 lines (26 loc) · 985 Bytes
/
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
name: Publish Python Package
on:
release:
types: [created]
jobs:
build-n-publish:
name: Build and publish Python wheel to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel flit
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build a binary wheel and a source tarball
run: python -m flit build
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}