Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
cache: 'pip' | |
cache-dependency-path: '**/pyproject.toml' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
- 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 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
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 }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v3 | |
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@v2 | |
with: | |
path: ./dist/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
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@v2 | |
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.1.7 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_token }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |