# This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: Python package on: push: branches: [ "*" ] pull_request: branches: [ master ] release: types: [ published ] jobs: build: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.9"] arch: [x86_64, aarch64] exclude: - os: windows-latest arch: aarch64 - arch: aarch64 # Python 2.7 does not have a supported manylinux image for ARM64 python-version: "2.7" - os: macos-latest python-version: "3.6" - os: windows-latest python-version: "3.6" - os: windows-latest python-version: "2.7" # Any supported C++ compiler can no longer target Python 2.7 - os: windows-latest python-version: "pypy2.7" # Any supported C++ compiler can no longer target Python 2.7 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - run: pip install --upgrade pip && pip install wheel - name: Set up Docker multiarch if: startsWith(matrix.os, 'ubuntu') uses: docker/setup-qemu-action@v2 - name: Build if: startsWith(matrix.os, 'ubuntu') run: | if [ "${{ matrix.python-version }}" == "2.7" ]; then manylinux_image=manylinux1 else manylinux_image=manylinux2014 fi image=quay.io/pypa/${manylinux_image}_${{ matrix.arch }} echo "Using image $image" docker run --user $(id -u) -i -w /src -v $PWD:/src $image ./make_manylinux.sh ${{ matrix.python-version }} ls -lR ./dist/ - name: Test run: | python setup.py test - name: Build if: "!startsWith(matrix.os, 'ubuntu')" run: | python setup.py bdist_wheel - name: Upload build artifact uses: actions/upload-artifact@v3 with: name: bdist_wheel path: dist/splitstream-*.whl retention-days: 7 publish: needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Build dist run: | python setup.py sdist - name: Download build artifact uses: actions/download-artifact@v3 with: name: bdist_wheel path: dist/ - run: | ls -lR dist/ - name: Publish to PyPi if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi }}