Skip to content

Commit

Permalink
add wheels action
Browse files Browse the repository at this point in the history
  • Loading branch information
rodluger committed Jan 28, 2021
1 parent 382b0ae commit f42da4f
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
87 changes: 87 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: wheels

on:
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

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

- uses: ilammy/msvc-dev-cmd@v1

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.5.1
- name: Build wheels on Windows
if: runner.os == 'Windows'
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp3?-win_amd64"
DISTUTILS_USE_SDK: 1
MSSdk: 1

- name: Build wheels on Mac and Linux
if: runner.os != 'Windows'
run: |
python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp3?-*"
CIBW_SKIP: "*-manylinux_i686"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014

- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0

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

- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
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_password }}
# To test: repository_url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img width="450" src="starry_process.gif"/>
<img width="450" src="https://raw.githubusercontent.com/rodluger/starry_process/master/starry_process.gif"/>
<br/>
<a href="https://github.com/rodluger/starry_process/actions?query=workflow%3Atests">
<img src="https://github.com/rodluger/starry_process/workflows/tests/badge.svg"/>
Expand Down

0 comments on commit f42da4f

Please sign in to comment.