Skip to content

Commit

Permalink
Add CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
lpsinger committed Apr 25, 2024
1 parent 9b2ca8f commit 8e4420c
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
76 changes: 76 additions & 0 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: build

on:
push:
pull_request:
release:
types:
- published

jobs:

source:
name: Build source package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: docker://python
with:
args: 'sh -c "pip install build && python -m build --sdist"'

- uses: actions/upload-artifact@v4
with:
name: source
path: dist/*

wheels:
name: Build binary packages
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-11, macos-14]

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Set up macOS compilers
if: runner.os == 'macOS'
run: |
echo "CIBW_ENVIRONMENT=CC=$(brew --prefix llvm@15)/bin/clang CXX=$(brew --prefix llvm@15)/bin/clang++ CPPFLAGS=-I$(brew --prefix libomp)/include LDFLAGS=-L$(brew --prefix libomp)/lib" >> "$GITHUB_ENV"
- name: Build wheels
uses: pypa/cibuildwheel@v2.17

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: wheelhouse/*

publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [source, wheels]
if: github.event_name == 'release'

steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: artifact/

0 comments on commit 8e4420c

Please sign in to comment.