You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
209 lines
4.4 KiB
209 lines
4.4 KiB
name: build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
concurrency:
|
|
group: build-${{ github.head_ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
COINCURVE_UPSTREAM_REF: d8a246324650c3df8d54d133a8ac3c1b857a7a4e
|
|
COINCURVE_IGNORE_SYSTEM_LIB: '1'
|
|
CIBW_BEFORE_ALL_MACOS: ./.github/scripts/install-macos-build-deps.sh
|
|
CIBW_ENVIRONMENT_PASS_LINUX: >
|
|
COINCURVE_UPSTREAM_REF
|
|
COINCURVE_IGNORE_SYSTEM_LIB
|
|
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_SKIP: >
|
|
pp*
|
|
|
|
jobs:
|
|
test:
|
|
name: Test latest Python
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
PYTHON_VERSION: '3.10'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Upgrade Python packaging tools
|
|
run: pip install --upgrade pip setuptools wheel
|
|
|
|
- name: Show runner information
|
|
run: |
|
|
python --version
|
|
pip --version
|
|
|
|
- name: Install dependencies
|
|
run: ./.github/scripts/install-test-deps.sh
|
|
|
|
- name: Check style and typing
|
|
run: tox -e lint,typing
|
|
|
|
- name: Run tests
|
|
run: tox -e ${PYTHON_VERSION}
|
|
|
|
- name: Run benchmarks
|
|
run: tox -e bench
|
|
|
|
- name: Upload coverage
|
|
run: codecov -X gcov
|
|
|
|
linux-wheels-standard:
|
|
name: Build Linux wheels
|
|
needs:
|
|
- test
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: wheelhouse/*.whl
|
|
if-no-files-found: error
|
|
|
|
macos-wheels-x86-64:
|
|
name: Build macOS wheels
|
|
needs:
|
|
- test
|
|
runs-on: macos-10.15
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
env:
|
|
CIBW_ARCHS_MACOS: x86_64
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: wheelhouse/*.whl
|
|
if-no-files-found: error
|
|
|
|
macos-wheels-arm:
|
|
name: Build macOS wheels for ARM
|
|
needs:
|
|
- test
|
|
runs-on: macos-10.15
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build wheels
|
|
uses: pypa/cibuildwheel@v2.3.1
|
|
env:
|
|
CIBW_ARCHS_MACOS: arm64
|
|
COINCURVE_CROSS_HOST: aarch64-apple-darwin
|
|
CFLAGS: -target arm64-apple-macos11
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: wheelhouse/*.whl
|
|
if-no-files-found: error
|
|
|
|
windows-wheels-and-sdist:
|
|
name: Build Windows wheels and source distribution
|
|
needs:
|
|
- test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install build dependencies
|
|
run: python -m pip install --upgrade cffi
|
|
|
|
- name: Build source distribution
|
|
run: python setup.py sdist
|
|
|
|
- name: Build Windows wheels
|
|
run: ./.github/scripts/build-windows-wheels.sh
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: dist/*
|
|
if-no-files-found: error
|
|
|
|
linux-wheels-arm:
|
|
name: Build Linux wheels for ARM
|
|
needs:
|
|
- test
|
|
runs-on: ubuntu-20.04
|
|
if: >
|
|
github.event_name == 'push'
|
|
&&
|
|
(github.ref == 'refs/heads/master' || startsWith(github.event.ref, 'refs/tags'))
|
|
|
|
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.1
|
|
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
|
|
needs:
|
|
- linux-wheels-standard
|
|
- macos-wheels-x86-64
|
|
- macos-wheels-arm
|
|
- windows-wheels-and-sdist
|
|
- linux-wheels-arm
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
|
|
|
|
steps:
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: dist
|
|
|
|
- name: Push build artifacts to PyPI
|
|
uses: pypa/gh-action-pypi-publish@v1.4.2
|
|
with:
|
|
skip_existing: true
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|