-
Notifications
You must be signed in to change notification settings - Fork 427
43 lines (38 loc) · 1.17 KB
/
release.yaml
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
43
name: Release
on:
release:
types: [published]
# For non-release, we want to exercise (a) building, (b) uploading to test.pypi.org
push:
branches: [master]
pull_request:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python -m pip install -e .[signals] -r requirements-dev.txt
- name: Build packages
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event_name == 'release' }}
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event_name != 'release' }}
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# Since we run this often, it's OK if that version already exists
skip_existing: true