-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (43 loc) · 1.47 KB
/
publish-to-test-and-live-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
43
44
45
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
push:
branches: [ main ]
tags: [ 'v*' ]
release:
types: [ published ]
jobs:
build-n-publish-linux:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 🐍 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Display Python 🐍
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel twine
- name: Install pybedforms
run: |
python setup.py install
- name: Build 🛠️ sdist source
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to Test PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
run: |
twine upload --non-interactive --skip-existing --repository testpypi dist/*
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags') && (github.event_name == 'push' || github.event_name == 'release')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --non-interactive --skip-existing dist/*