python-dependency-injector/.github/workflows/publishing.yml

68 lines
1.8 KiB
YAML
Raw Normal View History

2021-01-26 16:21:33 +03:00
name: Publishing
2021-01-26 16:12:33 +03:00
on:
push:
tags:
2021-01-26 16:13:54 +03:00
- '*'
2021-01-26 16:12:33 +03:00
jobs:
2021-01-26 17:20:41 +03:00
build-sdist:
name: Build source tarball
2021-01-26 16:12:33 +03:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: python setup.py sdist
2021-01-26 17:20:41 +03:00
- uses: actions/upload-artifact@v2
with:
path: ./dist/*
2021-01-26 16:26:23 +03:00
2021-01-26 17:20:41 +03:00
build-wheels:
name: Build Linux wheels (x64)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
2021-01-26 16:26:23 +03:00
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip install cibuildwheel==1.8.0
2021-01-26 17:05:40 +03:00
- name: Install Visual C++ for Python 2.7 on Windows
if: runner.os == 'Windows'
run: |
choco install vcpython27 -f -y
2021-01-26 16:26:23 +03:00
- run: cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
2021-01-26 17:20:41 +03:00
upload-to-pypi:
name: Publish on PyPI
needs: [build-sdist, build-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
# - services: docker
# arch: arm64
# if: tag IS present
# env: TWINE_USERNAME=__token__
# install: python3 -m pip install cibuildwheel==1.6.3
# script: python3 -m cibuildwheel --output-dir wheelhouse
# after_success:
# - python3 -m pip install --upgrade --upgrade-strategy eager twine
# - python3 -m twine upload wheelhouse/*.whl