Skip to content

[pre-commit.ci] pre-commit autoupdate #124

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #124

name: Build and deploy
on:
pull_request:
push:
tags:
- "**"
workflow_dispatch:
jobs:
build_wheels:
name: "Build pyglui wheels on ${{ matrix.os }}"
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
continue-on-error: true
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v2
if: always()
with:
name: distribution
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install libglew-dev
pip install build
- name: Build source package
run: python -m build --sdist .
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox --installpkg dist/*.tar.gz
- name: Upload source package
uses: actions/upload-artifact@v2
with:
name: distribution
path: dist/
publish:
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: distribution
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}