Bump pypa/gh-action-pypi-publish from 1.4.2 to 1.12.3 #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and upload to PyPI | |
# Build on every branch push, tag push, and pull request change: | |
on: [push, pull_request] | |
# Alternatively, to publish when a (published) GitHub Release is created, use the following: | |
# on: | |
# push: | |
# pull_request: | |
# release: | |
# types: | |
# - published | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} - ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
arch: ['x86_64'] | |
cibw_python: ["cp*"] | |
include: | |
- arch: arm64 | |
cibw_python: "cp*" | |
os: macos-latest | |
# tests are failing for now on windows. | |
#- arch: AMD64 | |
# cibw_python: "cp*" | |
# os: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_BUILD_VERBOSITY_MACOS: 3 | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_BUILD: ${{ matrix.cibw_python }} | |
CIBW_TEST_COMMAND: pytest {project}/test | |
CIBW_TEST_REQUIRES: pytest | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
# 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@v2 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |