Skip to content

Commit

Permalink
Merge pull request #7 from ssciwr/cleanup-deploy
Browse files Browse the repository at this point in the history
Cleanup deploy
  • Loading branch information
dokempf authored Nov 25, 2020
2 parents 2a993db + 9a36deb commit 16290b3
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 109 deletions.
60 changes: 0 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types:
- published

env:
BUILD_TYPE: Release
Expand Down Expand Up @@ -46,60 +43,3 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build
run: ctest

build-wheels:
needs: [build-and-test]
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Build wheels only when Github releases are created
if: github.event_name == 'release' && github.event.action == 'published'

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 only when Github releases are created
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_API_TOKEN }}
59 changes: 59 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Wheels + PyPI deploy

on:
release:
types:
- published

jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

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
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 }}
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ to the cmake command.

# Deploying the Python interface

In order to do this, `docker` needs to be installed and the permissions for `docker`
must be given. Then, the deployment process should be automated like this:

```
./bin/deploy.sh
```
The Python packages are currently built using Github Actions with the project
`ciwheelbuild`. A wheel build and deploy can be triggered by creating a release
in Github. Of course, Github Actions should be enabled and the PyPI API access
token needs to be stored a secret on the project.
27 changes: 0 additions & 27 deletions bin/build-wheels.sh

This file was deleted.

15 changes: 0 additions & 15 deletions bin/deploy.sh

This file was deleted.

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.7',
version='0.8',
author='Dominic Kempf, Liam Keegan',
author_email='[email protected]',
description='A fast tool to calculate Hamming distances',
Expand Down

0 comments on commit 16290b3

Please sign in to comment.