fix upload-artifact's name to be unique for matrix build #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 + Deploy | |
on: | |
push: | |
branches: [main] | |
tags: ["v*.*.*"] | |
pull_request: | |
branches: [main] | |
release: | |
types: | |
- published | |
jobs: | |
build_sdist: | |
name: Build sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Build sdist | |
run: pipx run --spec build pyproject-build --sdist | |
- name: Check sdist metadata | |
run: pipx run twine check dist/*.tar.gz | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.tar.gz | |
name: sdist | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
# macos-13 runners are still x86_64, macos-14 (latest) are arm64; we want to build | |
# the x86_64 wheel on/for x86_64 macs | |
matrix: | |
os: [ "ubuntu-latest", "macos-13", "windows-latest" ] | |
env: | |
CIBW_ARCHS_LINUX: x86_64 | |
CIBW_ARCHS_MACOS: x86_64 universal2 | |
# Building for one python version is enough, since this is a | |
# 'universal binary wheel' (py3-none-*) not | |
# linked to a specific python version or implementation. | |
CIBW_BUILD: "cp310-*" | |
# Increase pip debugging output | |
CIBW_BUILD_VERBOSITY: 1 | |
# Increase delocate-wheel debugging output | |
# CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-listdeps {wheel} && delocate-wheel -vv --require-archs {delocate_archs} -w {dest_dir} {wheel} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Set up msbuild (Windows-only) | |
uses: microsoft/[email protected] | |
if: startsWith(matrix.os, 'windows') | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Build wheels | |
run: pipx run cibuildwheel --output-dir dist | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/*.whl | |
name: wheels-${{ matrix.os }} | |
deploy: | |
name: Upload if release | |
needs: [build_sdist, build_wheels] | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} |