Skip to content

Commit

Permalink
Merge pull request #3 from ssciwr/ci-deploy
Browse files Browse the repository at this point in the history
Set up Github actions to deploy to PyPI
  • Loading branch information
dokempf authored Nov 24, 2020
2 parents e3f48c2 + 61de521 commit 07d0038
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 6 deletions.
63 changes: 60 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
AVX512: OFF

jobs:
build:

build-and-test:
name: Testing on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -42,4 +42,61 @@ jobs:
- name: run tests
shell: bash
working-directory: ${{runner.workspace}}/build
run: ctest
run: ctest

build-wheels:
needs: [build-and-test]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Build wheels on every tag starting with 'v' (saves some build time)
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')

strategy:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]

steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.4
- name: Install Visual C++ for Python 2.7
if: runner.os == 'Windows'
run: |
choco install vcpython27 -f -y
- name: Build wheels
env:
CIBW_BEFORE_BUILD: python -m pip install cmake
CIBW_SKIP: "*-win32"
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

upload_pypi:
needs: [build-wheels]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ project(covid-tda LANGUAGES CXX)

cmake_minimum_required(VERSION 3.11)

include(CTest)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 11)

Expand Down Expand Up @@ -33,8 +35,6 @@ set(HAMMING_WITH_AVX512
# Add git submodules
add_subdirectory(ext)

include(CTest)

# Build the hamming library
add_subdirectory(src)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def build_extension(self, ext):

setup(
name='hammingdist',
version='0.6',
version='0.7',
author='Dominic Kempf, Liam Keegan',
author_email='ssc@iwr.uni-heidelberg.de',
description='A fast tool to calculate Hamming distances',
Expand Down

0 comments on commit 07d0038

Please sign in to comment.