build(deps): bump actions/upload-artifact from 3 to 4 #122
Workflow file for this run
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: Python | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
release: | |
types: | |
- published | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, windows-2019, macos-12] | |
steps: | |
- uses: actions/checkout@v4 | |
# Needed to build non-native architectures. | |
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation | |
- name: Setup QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
# While arm64 wheels can be built on x86_64, they cannot be tested. | |
# The ability to test the arm64 wheels will be added in a future | |
# release of cibuildwheel, once Apple Silicon CI runners are widely | |
# available. | |
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-packages-${{ matrix.runs-on }} | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build sdist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: python-packages-${{ matrix.runs-on }} | |
path: dist/*.tar.gz | |
publish: | |
needs: | |
- build_wheels | |
- build_sdist | |
runs-on: ubuntu-latest | |
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
pattern: python-packages-* | |
path: dist | |
merge-multiple: true | |
# - name: Publish packages to TestPyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.TEST_PYPI_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
- name: Publish packages to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |