Skip to content

Merge branch 'stable' into github_release #22

Merge branch 'stable' into github_release

Merge branch 'stable' into github_release #22

name: Non-vendored Wheels
on:
workflow_dispatch:
pull_request:
branches:
- stable
release:
types:
- published
jobs:
build_sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install deps
run: python -m pip install twine build
- name: Build SDist
run: python -m build -s
- name: Check metadata
run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: artifact-sdist
path: dist/*.tar.gz
build_wheels:
name: Wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheel
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ENVIRONMENT: CMAKE_ARGS="-DDIPTEST_ENABLE_ARCH_FLAGS=OFF -DDIPTEST_ENABLE_OPENMP=OFF"
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="10.13" CMAKE_ARGS="-DDIPTEST_ENABLE_ARCH_FLAGS=OFF -DDIPTEST_ENABLE_OPENMP=OFF"
- name: Show files
run: ls -lh wheelhouse
shell: bash
- name: Verify clean directory
run: git diff --exit-code
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}
path: wheelhouse/*.whl
github-release:
name: Create github release
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- name: Download all the dists
- uses: actions/download-artifact@v4
with:
pattern: artifact-*
merge-multiple: true
path: dist
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'