-
Notifications
You must be signed in to change notification settings - Fork 28
64 lines (62 loc) · 1.98 KB
/
pythonpackage.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Python package
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.11, '3.10', 3.9, 3.8]
changed-dir: ["qaseio", "qase-pytest", "qase-robotframework", "qase-python-commons"]
name: Project ${{ matrix.changed-dir }} - Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
list-files: 'shell'
filters: |
changes:
- '${{ matrix.changed-dir }}/**'
- name: Set up Python ${{ matrix.python-version }}
if: steps.filter.outputs.changes == 'true'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
if: steps.filter.outputs.changes == 'true'
run: |
python -m pip install --upgrade pip
pip install tox
- name: Lint with tox
if: steps.filter.outputs.changes == 'true'
working-directory: ./${{ matrix.changed-dir }}
run: |
tox
build-n-publish:
runs-on: ubuntu-latest
needs: test
strategy:
max-parallel: 1
matrix:
prefix: [ "qaseio", "qase-pytest", "qase-robotframework", "qase-python-commons" ]
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
if: contains(github.event.ref, matrix.prefix)
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Build a binary wheel and a source tarball
if: contains(github.event.ref, matrix.prefix)
working-directory: ./${{ matrix.prefix }}
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
if: contains(github.event.ref, matrix.prefix)
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_PASSWORD }}
packages_dir: ./${{ matrix.prefix }}/dist