Skip to content

build(deps): bump actions/download-artifact from 3 to 4 #20

build(deps): bump actions/download-artifact from 3 to 4

build(deps): bump actions/download-artifact from 3 to 4 #20

Workflow file for this run

name: Continuous integration
on:
push:
release:
types: [ published ]
workflow_dispatch:
inputs:
deploy_trigger:
description: Force a deployment to PyPI
default: "false"
required: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install .
- name: Lint with flake8
run: |
pip install --upgrade flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --statistics
test:
needs: lint
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
- name: Run tox with tox-gh-actions
uses: ymyzk/run-tox-gh-actions@main
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
needs: test
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build
- name: Build wheels
run: python -m build --wheel
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: "3.10"
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel build
- name: Build wheels
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: >
(github.event_name == 'release' && github.event.action == 'published')
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy_trigger == 'true')
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}
# To test: repository_url: https://test.pypi.org/legacy/