-
Notifications
You must be signed in to change notification settings - Fork 110
42 lines (35 loc) · 997 Bytes
/
publish-to-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
37
38
39
40
41
42
name: "Publish to PyPI"
on:
push:
branches: [ develop ]
tags: [ '*' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ develop ]
schedule:
- cron: '30 22 15 * *'
jobs:
build-and-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: |
pip install build
pip list
- name: Build a binary wheel and a source tarball
run: python -m 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 }}
- uses: actions/upload-artifact@v3
with:
name: pypi-packages
path: dist/