-
Notifications
You must be signed in to change notification settings - Fork 45
43 lines (31 loc) · 1.07 KB
/
cicd.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
name: Tests and push to PyPi and DockerHub
on: push
jobs:
push_to_pypi:
name: Push to PyPi
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build and push the release
run: >-
python setup.py sdist
# All the tags go to PyPI test
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# Only non-alpha releases go to the official PyPi
- name: Publish distribution to PyPI (official release)
if: contains(github.ref, 'alpha') != true
uses: pypa/gh-action-pypi-publish@master