Skip to content

Bump the actions group with 4 updates (#75) #67

Bump the actions group with 4 updates (#75)

Bump the actions group with 4 updates (#75) #67

name: Build and upload
on:
pull_request:
push:
tags:
- "*"
branches:
- "main"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14, macos-13]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
- uses: actions/upload-artifact@v4
with:
name: pymeshfix-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install pipx
run: python -m pip install --upgrade pipx pip
- name: Build sdist
run: pipx run build --sdist
- name: Install package from sdist
run: pip install dist/*.tar.gz
- name: Install test requirements
run: pip install -r requirements_test.txt
- name: Run tests
run: pytest
- uses: actions/upload-artifact@v4
with:
name: pymeshfix-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
# upload to PyPI on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@v1.12.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
./dist/*.whl