Skip to content

Commit

Permalink
added packaging and upload to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed Dec 20, 2023
1 parent 2867f29 commit b5fad7f
Showing 1 changed file with 55 additions and 18 deletions.
73 changes: 55 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,61 56,63 @@ jobs:

#-----------------------------------------------------------------------------
quality:
name: Quality / ${{ matrix.os }} / Python ${{ matrix.python-version }}

name: Quality / ${{ matrix.os.name }} / Python ${{ matrix.python.version }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
python-version: ['3.11']
os:
- {name: 'ubuntu-22.04', pip_cache: '~/.cache/pip'}
python:
- {version: '3.11', requirements: 'requirements-test-3_11.txt'}

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.name }}

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python.version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: quality-pip-${{ hashFiles('requirements-dev-3_11.txt', '.github/workflows/ci.yml') }}
path: ${{ matrix.os.pip_cache }}
key: quality-pip-${{ hashFiles(matrix.python.requirements, '.github/workflows/ci.yml') }}
restore-keys: quality-pip-

- run: |
python -m pip install --upgrade pip
pip install -r requirements-dev-3_11.txt
pip install -r ${{ matrix.python.requirements }}
- run: inv quality

#-----------------------------------------------------------------------------
test_ex:
name: Test Examples / ${{ matrix.os }} / Python ${{ matrix.python-version }}

name: Test Examples / ${{ matrix.os.name }} / Python ${{ matrix.python.version }}
strategy:
fail-fast: false
matrix:
os: ['ubuntu-22.04']
python-version: ['3.11']
os:
- {name: 'ubuntu-22.04', pip_cache: '~/.cache/pip'}
python:
- {version: '3.11', requirements: 'requirements-test-3_11.txt'}

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os.name }}

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python.version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: quality-pip-${{ hashFiles('requirements-test-3_11.txt', '.github/workflows/ci.yml') }}
key: quality-pip-${{ hashFiles(matrix.python.requirements, '.github/workflows/ci.yml') }}
restore-keys: quality-pip-

- run: |
python -m pip install --upgrade pip
pip install -r requirements-test-3_11.txt
pip install -r ${{ matrix.python.requirements }}
- run: inv testex --cov

Expand All @@ -119,4 121,39 @@ jobs:
token: 6de39346-7381-441d-80d3-a6c0c051be2d
files: coverage.xml
fail_ci_if_error: false
verbose: true
verbose: true

#-----------------------------------------------------------------------------
package:
name: Package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.12
- run: pip install -r requirements-dev-3_12.txt
- run: python setup.py sdist
- run: python setup.py bdist_wheel

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

#-----------------------------------------------------------------------------
upload:
name: Publish
if: github.event_name == 'release'

needs: [test, quality, test_ex, package]
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true

0 comments on commit b5fad7f

Please sign in to comment.