Skip to content

Commit

Permalink
build linux wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Jan 11, 2023
1 parent 44f24db commit 94ab971
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,50 @@ jobs:
continue-on-error: true
uses: AndreMiras/coveralls-python-action@v20201129

release:
build_sdist:
needs: pytest
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
- run: python -m pip install build
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

build_wheels:
needs: pytest
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.task == 'release')
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['38', '39', '310']
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Release
- name: Build wheels
uses: pypa/cibuildwheel@v2.11.4
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
python -m pip install --upgrade pip twine build
python -m build
python -m twine upload --skip-existing dist/*.whl dist/*.tar.gz
CIBW_BUILD: cp${{ matrix.python-version }}-*
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

release:
needs: [build_wheels, build_sdist]
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.task == 'release')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.TWINE_USERNAME }}
password: ${{ secrets.TWINE_PASSWORD }}

0 comments on commit 94ab971

Please sign in to comment.