|
|
@ -11,37 +11,40 @@ on: |
|
|
|
branches: |
|
|
|
- master |
|
|
|
|
|
|
|
concurrency: |
|
|
|
group: ${{ github.head_ref }} |
|
|
|
cancel-in-progress: true |
|
|
|
|
|
|
|
env: |
|
|
|
PYTHON_VERSION_BUILD_EXTRA: '3.9' |
|
|
|
COINCURVE_UPSTREAM_REF: f2d9aeae6d5a7c7fbbba8bbb38b1849b784beef7 |
|
|
|
LD_LIBRARY_PATH: ./libsecp256k1_ext/.libs |
|
|
|
DYLD_FALLBACK_LIBRARY_PATH: ./libsecp256k1_ext/.libs |
|
|
|
LIB_DIR: ./libsecp256k1_ext/.libs |
|
|
|
INCLUDE_DIR: ./libsecp256k1_ext/include |
|
|
|
CIBW_ENVIRONMENT_PASS_LINUX: > |
|
|
|
COINCURVE_UPSTREAM_REF |
|
|
|
CIBW_TEST_COMMAND: > |
|
|
|
python -c |
|
|
|
"from coincurve import PrivateKey; |
|
|
|
a=PrivateKey(); |
|
|
|
b=PrivateKey(); |
|
|
|
assert a.ecdh(b.public_key.format())==b.ecdh(a.public_key.format()) |
|
|
|
" |
|
|
|
CIBW_BEFORE_ALL_LINUX: ./.github/scripts/install-linux-build-deps.sh |
|
|
|
CIBW_SKIP: > |
|
|
|
pp* |
|
|
|
|
|
|
|
jobs: |
|
|
|
test: |
|
|
|
name: "Test ${{ !startsWith(matrix.python-version, 'pypy') && 'Python ' || '' }}${{ startsWith(matrix.python-version, 'pypy') && 'PyPy' || matrix.python-version }} on ${{ startsWith(matrix.os, 'ubuntu-') && 'Ubuntu' || 'macOS' }}" |
|
|
|
runs-on: ${{ matrix.os }} |
|
|
|
strategy: |
|
|
|
fail-fast: false |
|
|
|
matrix: |
|
|
|
os: [ubuntu-18.04, macos-10.15] |
|
|
|
python-version: ['3.6', '3.7', '3.8', '3.9'] |
|
|
|
include: |
|
|
|
- os: ubuntu-18.04 |
|
|
|
python-version: pypy3 |
|
|
|
name: Test latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
env: |
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }} |
|
|
|
OS_NAME: ${{ matrix.os }} |
|
|
|
PYTHON_VERSION: '3.10' |
|
|
|
|
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }} |
|
|
|
- name: Set up Python ${{ env.PYTHON_VERSION }} |
|
|
|
uses: actions/setup-python@v2 |
|
|
|
with: |
|
|
|
python-version: ${{ matrix.python-version }} |
|
|
|
python-version: ${{ env.PYTHON_VERSION }} |
|
|
|
|
|
|
|
- name: Upgrade Python packaging tools |
|
|
|
run: pip install --upgrade pip setuptools wheel |
|
|
@ -51,17 +54,10 @@ jobs: |
|
|
|
python --version |
|
|
|
pip --version |
|
|
|
|
|
|
|
- name: Install system dependencies |
|
|
|
run: ./.github/scripts/install-system-deps.sh |
|
|
|
|
|
|
|
- name: Install build dependencies |
|
|
|
run: python -m pip install --upgrade cffi |
|
|
|
|
|
|
|
- name: Install test dependencies |
|
|
|
run: python -m pip install --upgrade tox codecov |
|
|
|
- name: Install dependencies |
|
|
|
run: ./.github/scripts/install-test-deps.sh |
|
|
|
|
|
|
|
- name: Check style and typing |
|
|
|
if: startsWith(matrix.os, 'ubuntu-') && matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
run: tox -e lint,typing |
|
|
|
|
|
|
|
- name: Run tests |
|
|
@ -73,69 +69,88 @@ jobs: |
|
|
|
- name: Upload coverage |
|
|
|
run: codecov -X gcov |
|
|
|
|
|
|
|
build: |
|
|
|
name: "Build ${{ !startsWith(matrix.python-version, 'pypy') && 'Python ' || '' }}${{ startsWith(matrix.python-version, 'pypy') && 'PyPy' || matrix.python-version }} ${{ startsWith(matrix.os, 'ubuntu-') && 'manylinux' || 'on' }} ${{ startsWith(matrix.os, 'ubuntu-') && 'wheels' || 'macOS' }}" |
|
|
|
runs-on: ${{ matrix.os }} |
|
|
|
unix-wheels-standard: |
|
|
|
name: Build ${{ startsWith(matrix.os, 'macos-') && 'macOS' || 'Linux' }} wheels |
|
|
|
needs: |
|
|
|
- test |
|
|
|
- test |
|
|
|
runs-on: ${{ matrix.os }} |
|
|
|
strategy: |
|
|
|
fail-fast: false |
|
|
|
matrix: |
|
|
|
os: [ubuntu-18.04, macos-10.15] |
|
|
|
python-version: ['3.6', '3.7', '3.8', '3.9'] |
|
|
|
include: |
|
|
|
- os: ubuntu-18.04 |
|
|
|
python-version: pypy3 |
|
|
|
env: |
|
|
|
PYTHON_VERSION: ${{ matrix.python-version }} |
|
|
|
OS_NAME: ${{ matrix.os }} |
|
|
|
os: [ubuntu-20.04, macos-10.15] |
|
|
|
|
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }} |
|
|
|
if: startsWith(matrix.os, 'macos-') || matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
uses: actions/setup-python@v2 |
|
|
|
with: |
|
|
|
python-version: ${{ matrix.python-version }} |
|
|
|
- name: Build wheels |
|
|
|
uses: pypa/cibuildwheel@v2.3.0 |
|
|
|
env: |
|
|
|
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh |
|
|
|
CIBW_ARCHS_MACOS: x86_64 arm64 |
|
|
|
|
|
|
|
- name: Upgrade Python packaging tools |
|
|
|
if: startsWith(matrix.os, 'macos-') || matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
run: pip install --upgrade pip setuptools wheel |
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
|
with: |
|
|
|
name: artifacts |
|
|
|
path: wheelhouse/*.whl |
|
|
|
if-no-files-found: error |
|
|
|
|
|
|
|
- name: Show runner information |
|
|
|
if: startsWith(matrix.os, 'macos-') || matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
run: | |
|
|
|
python --version |
|
|
|
pip --version |
|
|
|
windows-wheels-and-sdist: |
|
|
|
name: Build Windows wheels and source distribution |
|
|
|
needs: |
|
|
|
- test |
|
|
|
runs-on: ubuntu-latest |
|
|
|
|
|
|
|
- name: Install system dependencies |
|
|
|
run: ./.github/scripts/install-system-deps.sh |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- name: Install build dependencies |
|
|
|
if: startsWith(matrix.os, 'macos-') || matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
run: python -m pip install --upgrade cffi |
|
|
|
|
|
|
|
- name: Prepare for cross-platform Windows build |
|
|
|
if: startsWith(matrix.os, 'ubuntu-') && matrix.python-version == env.PYTHON_VERSION_BUILD_EXTRA |
|
|
|
run: ./.github/scripts/prepare-windows-build.sh |
|
|
|
- name: Build source distribution |
|
|
|
run: python setup.py sdist |
|
|
|
|
|
|
|
- name: Build package |
|
|
|
run: ./.github/scripts/build.sh |
|
|
|
- name: Build Windows wheels |
|
|
|
run: ./.github/scripts/build-windows-wheels.sh |
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
|
if: always() |
|
|
|
with: |
|
|
|
name: artifacts |
|
|
|
path: dist/* |
|
|
|
if-no-files-found: error |
|
|
|
|
|
|
|
unix-wheels-arm: |
|
|
|
name: Build Linux wheels for ARM |
|
|
|
needs: |
|
|
|
- test |
|
|
|
runs-on: ubuntu-20.04 |
|
|
|
if: github.ref == 'refs/heads/master' |
|
|
|
|
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
|
|
|
|
- name: Set up QEMU |
|
|
|
uses: docker/setup-qemu-action@v1 |
|
|
|
with: |
|
|
|
platforms: arm64 |
|
|
|
|
|
|
|
- name: Build wheels |
|
|
|
uses: pypa/cibuildwheel@v2.3.0 |
|
|
|
env: |
|
|
|
CIBW_ARCHS_LINUX: aarch64 |
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2 |
|
|
|
with: |
|
|
|
name: artifacts |
|
|
|
path: wheelhouse/*.whl |
|
|
|
if-no-files-found: error |
|
|
|
|
|
|
|
publish: |
|
|
|
name: Publish release |
|
|
|
runs-on: ubuntu-latest |
|
|
|
needs: |
|
|
|
- build |
|
|
|
|
|
|
|
# Only publish tags |
|
|
|
- unix-wheels-standard |
|
|
|
- windows-wheels-and-sdist |
|
|
|
- unix-wheels-arm |
|
|
|
runs-on: ubuntu-latest |
|
|
|
if: github.event_name == 'create' && github.event.ref_type == 'tag' |
|
|
|
|
|
|
|
steps: |
|
|
@ -145,7 +160,7 @@ jobs: |
|
|
|
path: dist |
|
|
|
|
|
|
|
- name: Push build artifacts to PyPI |
|
|
|
uses: pypa/gh-action-pypi-publish@v1.4.1 |
|
|
|
uses: pypa/gh-action-pypi-publish@v1.4.2 |
|
|
|
with: |
|
|
|
skip_existing: true |
|
|
|
user: __token__ |
|
|
|