Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #31

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #31

Workflow file for this run

name: Python package
on:
push:
pull_request:
release:
types:
- published
jobs:
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install black isort flake8 bandit[toml]
- run: python -m black . --check
- run: python -m isort . --check-only
- run: python -m flake8 .
- run: python -m bandit . --recursive -c pyproject.toml
test:
needs: lint
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install .
- name: Run tests
run: |
cd tests
python -m unittest discover
build-wheels:
if: github.event_name == 'release' && github.event.action == 'published'
needs: test
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install setuptools wheel cython cibuildwheel==2.3.0
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
build-sdist:
if: github.event_name == 'release' && github.event.action == 'published'
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install build
- name: Build dists
run: |
python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload-pypi:
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4.1.7
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}