name: Deploy on: push: tags: - '*' env: libarchive_tag: v3.6.1 jobs: build_wheels: name: Build wheels runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build wheels uses: pypa/cibuildwheel@v2.9.0 env: CIBW_ENVIRONMENT: INCLUDE=/usr/local/include LIBARCHIVE_PREFIX=/usr/local CIBW_PYTHON_VERSIONS: 3.8,3.9,3.10 CIBW_BEFORE_ALL: bash -x build-libarchive-lib.sh centos ${{ env.libarchive_tag }} - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl build_sdist: name: Build source distribution runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Build sdist run: pipx run 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 == 'push' && startsWith(github.ref, 'refs/tags') steps: - uses: actions/download-artifact@v3 with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir name: artifact path: dist - name: Deploy wheels to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }}