Skip to content

bump dependencies, overhaul build action (#21) #1

bump dependencies, overhaul build action (#21)

bump dependencies, overhaul build action (#21) #1

Workflow file for this run

name: Build and Publish
# NOTE: build logic is duplicated here and in test_build.yml
# Run on the main branch for commits only
on:
push:
branches:
- master
jobs:
build_wheels:
# only run if the most recent commit contains '[ci publish]'
if: "contains(github.event.head_commit.message, '[ci publish]')"
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
name: Build wheels ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Package source distribution
if: runner.os == 'Linux'
run: |
python -m pip install build
python -m build --sdist
- name: Run cibuildwheel
uses: pypa/[email protected]
with:
config-file: ".github/workflows/cibuildwheel_config.toml"
# Upload binaries to the github artifact store
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: |
./wheelhouse/*.whl
./wheelhouse/*.tar.gz
overwrite: true
# Push the resulting binaries to pypi on a tag starting with 'v'
upload_pypi:
name: Upload release to PyPI
# only run if the most recent commit contains '[ci publish]'
if: "contains(github.event.head_commit.message, '[ci publish]')"
needs: [build_wheels]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/robust-laplacian/
permissions: # we authenticate via PyPI's 'trusted publisher' workflow, this permission is required
id-token: write
steps:
- name: Download built wheels artifact # downloads from the jobs storage from the previous step
uses: actions/[email protected]
with:
# omitting the `name: ` field downloads all artifacts from this workflow
path: dist
- name: List downloaded files from artifact
run: ls dist | cat # piping through cat prints one per line
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# To test: repository_url: https://test.pypi.org/legacy/