From f42da4f8d29b9b10572d4065b8a18fb94a32db4e Mon Sep 17 00:00:00 2001 From: Rodrigo Luger Date: Thu, 28 Jan 2021 17:07:50 -0500 Subject: [PATCH] add wheels action --- .github/workflows/wheels.yml | 87 ++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..02cd0bb --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,87 @@ +name: wheels + +on: + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: "3.7" + + - uses: ilammy/msvc-dev-cmd@v1 + + - name: Install cibuildwheel + run: | + python -m pip install cibuildwheel==1.5.1 + - name: Build wheels on Windows + if: runner.os == 'Windows' + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp3?-win_amd64" + DISTUTILS_USE_SDK: 1 + MSSdk: 1 + + - name: Build wheels on Mac and Linux + if: runner.os != 'Windows' + run: | + python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: "cp3?-*" + CIBW_SKIP: "*-manylinux_i686" + CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: "3.7" + + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + # To test: repository_url: https://test.pypi.org/legacy/ diff --git a/README.md b/README.md index 0eff8e9..7ae2970 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +