2021-01-27 05:11:27 +03:00
|
|
|
name: Publishing
|
|
|
|
|
|
|
|
on:
|
2022-12-19 05:09:14 +03:00
|
|
|
workflow_dispatch:
|
2021-01-27 05:11:27 +03:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2021-01-27 15:45:48 +03:00
|
|
|
tests:
|
|
|
|
name: Run tests
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 15:45:48 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
2024-08-07 05:41:24 +03:00
|
|
|
python-version: 3.12
|
2021-01-27 15:45:48 +03:00
|
|
|
- run: pip install tox
|
|
|
|
- run: tox
|
|
|
|
env:
|
2024-08-07 05:41:24 +03:00
|
|
|
TOXENV: 3.12
|
2021-01-27 15:45:48 +03:00
|
|
|
|
|
|
|
linters:
|
|
|
|
name: Run linters
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 15:45:48 +03:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
toxenv: [flake8, pydocstyle, mypy, pylint]
|
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
2024-08-07 05:41:24 +03:00
|
|
|
python-version: 3.12
|
2021-01-27 15:45:48 +03:00
|
|
|
- run: pip install tox
|
|
|
|
- run: tox
|
|
|
|
env:
|
|
|
|
TOXENV: ${{ matrix.toxenv }}
|
|
|
|
|
|
|
|
build-sdist:
|
|
|
|
name: Build source tarball
|
|
|
|
needs: [tests, linters]
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 15:45:48 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
2024-08-07 05:41:24 +03:00
|
|
|
python-version: 3.12
|
2024-08-08 03:48:41 +03:00
|
|
|
- run: |
|
|
|
|
python -m pip install --upgrade pip setuptools
|
|
|
|
python setup.py sdist
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
|
|
|
path: ./dist/*
|
|
|
|
|
|
|
|
build-wheels:
|
|
|
|
name: Build wheels
|
|
|
|
needs: [tests, linters]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-12-19 05:09:14 +03:00
|
|
|
os: [ubuntu-22.04, windows-2019, macos-11]
|
2021-04-26 00:37:08 +03:00
|
|
|
env:
|
|
|
|
CIBW_SKIP: cp27-win*
|
2021-01-27 15:45:48 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Build wheels
|
2024-08-08 04:04:37 +03:00
|
|
|
uses: pypa/cibuildwheel@v2.20.0
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
|
|
|
path: ./wheelhouse/*.whl
|
|
|
|
|
|
|
|
build-wheels-linux-aarch64:
|
2022-12-19 05:09:14 +03:00
|
|
|
name: Build wheels (ubuntu-22.04-aarch64)
|
2021-01-27 15:45:48 +03:00
|
|
|
needs: [tests, linters]
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 15:45:48 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
2021-01-27 15:45:48 +03:00
|
|
|
- name: Set up QEMU
|
2022-12-19 05:09:14 +03:00
|
|
|
if: runner.os == 'Linux'
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
- name: Build wheels
|
2024-08-08 04:04:37 +03:00
|
|
|
uses: pypa/cibuildwheel@v2.20.0
|
2022-12-19 05:09:14 +03:00
|
|
|
env:
|
|
|
|
CIBW_ARCHS_LINUX: aarch64
|
|
|
|
- uses: actions/upload-artifact@v3
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
|
|
|
path: ./wheelhouse/*.whl
|
|
|
|
|
|
|
|
publish:
|
|
|
|
name: Publish on PyPI
|
|
|
|
needs: [build-sdist, build-wheels, build-wheels-linux-aarch64]
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 15:45:48 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/download-artifact@v3
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
|
|
|
name: artifact
|
|
|
|
path: dist
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
2021-01-27 15:45:48 +03:00
|
|
|
with:
|
|
|
|
user: __token__
|
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
2022-12-19 05:09:14 +03:00
|
|
|
# For publishing to Test PyPI, uncomment next two lines:
|
|
|
|
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
|
|
# repository_url: https://test.pypi.org/legacy/
|
2021-01-27 05:11:27 +03:00
|
|
|
|
|
|
|
publish-docs:
|
|
|
|
name: Publish docs
|
2021-01-27 15:45:48 +03:00
|
|
|
needs: [publish]
|
2022-12-19 05:09:14 +03:00
|
|
|
runs-on: ubuntu-22.04
|
2021-01-27 05:11:27 +03:00
|
|
|
steps:
|
2022-12-19 05:09:14 +03:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-01-27 05:11:27 +03:00
|
|
|
with:
|
2024-08-07 05:41:24 +03:00
|
|
|
python-version: 3.12
|
2021-01-27 05:11:27 +03:00
|
|
|
- run: pip install -r requirements-doc.txt
|
|
|
|
- run: pip install awscli
|
|
|
|
- run: pip install -e .
|
|
|
|
- run: (cd docs && make clean html)
|
|
|
|
- run: |
|
|
|
|
aws s3 sync docs/_build/html s3://python-dependency-injector-docs --delete
|
|
|
|
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --path "/*" > /dev/null
|
|
|
|
echo "Cache invalidation triggered"
|
|
|
|
env:
|
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
|
|
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
|