name: Upload Python Package on: push: tags: - dulwich-* jobs: deploy: runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-latest, windows-latest] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] include: - os: ubuntu-latest python-version: '3.x' # path encoding fail-fast: false steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install native dependencies (Ubuntu) run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev if: "matrix.os == 'ubuntu-latest'" - name: Install native dependencies (MacOS) run: brew install swig gpgme if: "matrix.os == 'macos-latest'" - name: Install dependencies run: | python -m pip install --upgrade pip pip install setuptools wheel twine fastimport - name: Install gpg on supported platforms run: pip install -U gpg if: "matrix.os != 'windows-latest' && matrix.python-version != 'pypy3'" - name: Run test suite run: | python -m unittest dulwich.tests.test_suite - name: Build run: | python setup.py sdist bdist_wheel if: "matrix.os != 'ubuntu-latest'" - uses: docker/setup-qemu-action@v1 name: Set up QEMU if: "matrix.os == 'ubuntu-latest'" - name: Build and publish (Linux aarch64) uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2014_aarch64 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' if: "matrix.os == 'ubuntu-latest'" - name: Build and publish (Linux) uses: RalfG/python-wheels-manylinux-build@v0.3.1 with: python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310' env: # Temporary fix for LD_LIBRARY_PATH issue. See # https://github.com/RalfG/python-wheels-manylinux-build/issues/26 LD_LIBRARY_PATH: /usr/local/lib:${{ env.LD_LIBRARY_PATH }} if: "matrix.os == 'ubuntu-latest'" - name: Publish (Linux) env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | # Only include *manylinux* wheels; the other wheels files are built but # rejected by pip. twine upload dist/*manylinux*.whl if: "matrix.os == 'ubuntu-latest'" - name: Publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | twine upload dist/*.whl if: "matrix.os != 'ubuntu-latest'"