diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a3d32f4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,73 @@ +name: Package release + +on: + release: + types: [created] + + +jobs: + deploy_osx: + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + os: [macos-latest] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: ${GITHUB_WORKSPACE}/.github/workflows/scripts/release_osx.sh + + deploy_linux: + strategy: + matrix: + python-version: + - cp37-cp37m + - cp38-cp38 + - cp39-cp39 + - cp10-cp10 + + runs-on: ubuntu-latest + container: quay.io/pypa/manylinux2014_x86_64 + steps: + - uses: actions/checkout@v1 + with: + submodules: true + - name: Set target Python version PATH + run: | + echo "/opt/python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: ${GITHUB_WORKSPACE}/.github/workflows/scripts/release_linux.sh + + deploy_windows: + runs-on: windows-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + ../../.github/workflows/scripts/release_windows.bat diff --git a/.github/workflows/scripts/release_linux.sh b/.github/workflows/scripts/release_linux.sh new file mode 100755 index 0000000..30bbce9 --- /dev/null +++ b/.github/workflows/scripts/release_linux.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +yum makecache -y +yum install centos-release-scl -y +yum-config-manager --enable rhel-server-rhscl-7-rpms +yum install llvm-toolset-7.0 python3 python3-devel -y + +# Python +python3 -m pip install --upgrade pip +python3 -m pip install setuptools wheel twine auditwheel + +# Publish +python3 -m pip wheel . -w dist/ --no-deps +twine upload --verbose --skip-existing dist/* diff --git a/.github/workflows/scripts/release_osx.sh b/.github/workflows/scripts/release_osx.sh new file mode 100755 index 0000000..1a4c109 --- /dev/null +++ b/.github/workflows/scripts/release_osx.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +export MACOSX_DEPLOYMENT_TARGET=10.14 + +python -m pip install --upgrade pip +pip install setuptools wheel twine auditwheel + +python3 setup.py build bdist_wheel --plat-name macosx_10_14_x86_64 --dist-dir wheel +twine upload --skip-existing wheel/* diff --git a/.github/workflows/scripts/release_windows.bat b/.github/workflows/scripts/release_windows.bat new file mode 100644 index 0000000..c6980ca --- /dev/null +++ b/.github/workflows/scripts/release_windows.bat @@ -0,0 +1,7 @@ +echo on + +python -m pip install --upgrade pip +pip install setuptools wheel twine auditwheel + +pip wheel . -w wheel/ --no-deps +twine upload --skip-existing wheel/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d38531..4df5bf6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.7', '3.8', '3.9'] + python-version: ['3.7', '3.8', '3.9', "3.10"] os: [macos-latest, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2