-
Notifications
You must be signed in to change notification settings - Fork 25
36 lines (29 loc) · 951 Bytes
/
pypi.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
name: Build and upload to PyPI
env:
CIBW_SKIP: cp27-* pp27-*
CIBW_BEFORE_BUILD: python -m pip install setuptools_scm
# Publish when a (published) GitHub Release is created:
on: push
jobs:
build_and_publish:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Get source code
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.9'
- name: Install build requirements
run: python -m pip install build wheel setuptools setuptools_scm
- name: Create distribution
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_TOKEN }}