-
Notifications
You must be signed in to change notification settings - Fork 169
40 lines (32 loc) · 1.04 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
pull_request:
push:
tags:
- '*'
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
if: ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || contains(github.event.pull_request.labels.*.name, 'Build wheels'))
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install python-build and twine
run: python -m pip install build twine
- name: Build package
run: python -m build --sdist --wheel .
- name: List result
run: ls -l dist
- name: Check long_description
run: python -m twine check dist/*
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}